Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Write down an algorithm to evaluate an expression given to you in postfix notation. Show the execution of your algorithm for the following given expression.
AB^CD-EF/GH+/+*
Ans.
Algorithm to evaluate Post fix Expression is shown as follows
Opndstk = the empty stack;
/*scan the input string reading one */
/*element at a time into symb */
while ( not end of input){
symb = next input character;
if (symb is an operand)
push (opndstk, symb);
else
{
/* symb is an operator */
opnd 2 = Pop (opnd stk);
opnd 1 = Pop (opnd stk);
value = result of applying symb to opnd 1 and opnd 2;
push (opndstk,value);
}/*end else */
}/*end while */
return (pop (opnd stk));
Symb
Opnd1
Opnd2
Value
Opndstk
A
B
A,B
^
A^B
C
A^B,C
D
A^B,C,D
-
C-D
A^B,C-D
E
A^B,C-D,E
F
A^B,C-D,E,F
/
E/F
A^B,C-D,E/F
G
A^B,C-D,E/F,G
H
A^B,C-D,E/F,G,H
+
G+H
A^B,C-D,E/F,G+H
(E/F)/(G+H)
A^B,C-D, (E/F) /(G+H)
(C-D)+(E/F)/(G+H)
A^B,(C-D)+
*
(C-
D)+(E/F)/(G+H)
A^B*((C-D)+
(E/F)/(G+H))
i cant resolve a problem
Data Structure and Algorithm 1. Explain linked list and its types. How do you represent linked list in memory? 2. List and elucidate the types of binary tree. 3. Descr
There are four data type groups: Integer kepts whole numbers and signed numbers Floating-point Stores real numbers (fractional values). Perfect for storing bank deposit
what is frequency count
Since the stack is list of elements, the queue is also a list of elements. The stack & the queue differ just in the position where the elements may be added or deleted. Similar to
What are stacks? A stack is a data structure that organizes data similar to how one organizes a pile of coins. The new coin is always placed on the top and the oldest is on the
Write the algorithm for Binary search. Also apply this algorithm on the following data. 22, 44, 11, 88, 33, 55, 77, 66
What is a first-in-first-out data structure ? Write algorithms to perform the following operations on it – create, insertion, deletion, for testing overflow and empty conditions.
Question 1 Explain the use of algorithms in computing Question 2 Explain time complexity and space complexity of an algorithm Question 3 Explain how you can analyz
Ordinary variable An ordinary variable of a easy data type can store a one element only
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd