Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

· WAP to convert an infix expression into its equivalent prefix notation.



3. Write a program for evaluating the value for a given postfix expression using stack data structure. 

a) Infix to Postfix

b)Prefix to Infix


1. Write a menu-driven program to perform the following operations in a single linked list by using suitable user-defined functions for each case.

a) Traversal of the list.

b) Check if the list is empty.

c) Insert a node at a certain position (at beginning/end/any position).

d) Delete a node at a certain position (at beginning/end/any position).

e) Delete a node for the given key.

f) Count the total number of nodes.

g) Search for an element in the linked list.

Verify & validate each function from main method.


2. WAP to display the contents of a linked list in reverse order





Write a program that accepts 10 values from the user at the keyboard and stores them in an array .Pass the array and it's size to a function that determines and displays the smallest and largest of the 10 values.


Write a method that receives elapsed time in seconds as a parameter.The method should then display the elapsed time in hours , minutes and seconds.For example , If the elapsed time is 9630 seconds , then the method should display 2:40:30 . Write a main() method that will prompt a user for elapsed time of an event in seconds, And use received value to demonstrate that the method works correctly.


Implement the following function. You may use the stack template class and the
stack operations of push, pop, peek, is_empty, and size. You may also use cin.peek( )
and use "cin>>i" to read an integer.
int evaluate_postfix_from_cin( )
// Precondition (Which is not checked): The next input line of cin is a
// properly formed postfix expression consisting of integers,
// the binary operations + and -, and spaces.
// Postcondition: The function has read the next input line (including
// the newline) and returned the value of the postfix expression.
{
int i;
stack<int> s;
Task 1:

Complete the body of this function. You do not need to check the precondition. You
may use the stack template class
bool balanced(const char p[ ], size_t n)
// Precondition: p[0]...p[n-1] contains n characters, each of which
// is '(', ')', '{' or '}'.
// Postcondition: The function returns true if the characters form a
// sequence of correctly balanced parentheses with each '(' matching
// a ')' and each '{' matching a '}'. Note that a sequence such as
// ( { ) } is NOT balanced because when we draw lines to match the
// parentheses to their partners, the lines cross each other. On the
// other hand, ( { } ) and { ( ) } are both balanced.
Task2:
Add the function to Task 1,Write a function that will swap pairs of elements in a given singlylinked list. Note that you have to actually swap the elements, not just the values, and that you
should modify the list in place (i.e. you should not create a copy of the list). For instance, the list
1->2->3->4->5->6->… becomes 2->1->4->3->6->5->…
Write a SortedInsert() function which given a list that is sorted in increasing order, and a single
node, inserts the node into the correct sorted position in the list. Use Insert() function of task 1
allocates a new node to add to the list, SortedInsert() takes an existing node, and just rearranges
pointers to insert it into the list.
Add a function to task 1 which accepts a linear linked list List and converts it to a circular linked
list.
Where List is a pointer to the front of the list.
Prototype of the function is as following
Node *Convert( Node *List)
The function below should insert a value as the head of a given UNORDERED linked list. Be
careful to first search for the given value. The value is inserted only if it does not exist in the
list. If the value exists, the function does nothing. Use Linked list implementation of Task 1 to
make this function run. Write down the code of insert function run the code, take snap shot
and paste it in your document.
struct Node{
int data;
Node* next;
};
The function prototype is given. Implement the function.
void insert(Node* &head, int value);
LATEST TUTORIALS
APPROVED BY CLIENTS