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. Draw the expression tree of the infix expression written below and then convert it intoPrefix and Postfix expressions.
((a + b) + c * (d + e) + f )* (g + h )
Ans:
The expression given is:
The postfix expression obtained is: ((a+b)+c*(d+e)+f)*(g+h) = ((ab+)+c*(de+)+f)*(gh+) = ((ab+)+(cde+*)+f)*(gh+) = ((ab+cde+*+)+f)*(gh+) = (ab+cde+*+f+)*(gh+) =(ab+cde+*+f+gh+*) The prefix expression obtained is: ((a+b)+c*(d+e)+f)*(g+h) = ((+ab)+c*(+de)+f)*(+gh) = ((+ab)+(*c+de)+f)*(+gh) = ((++ab*c+de)+f)*(+gh) = (+++ab*c+def)*(+gh) = (*+++ab*c+def+gh)
The postfix expression obtained is:
((a+b)+c*(d+e)+f)*(g+h)
= ((ab+)+c*(de+)+f)*(gh+)
= ((ab+)+(cde+*)+f)*(gh+)
= ((ab+cde+*+)+f)*(gh+)
= (ab+cde+*+f+)*(gh+)
=(ab+cde+*+f+gh+*)
The prefix expression obtained is:
= ((+ab)+c*(+de)+f)*(+gh)
= ((+ab)+(*c+de)+f)*(+gh)
= ((++ab*c+de)+f)*(+gh)
= (+++ab*c+def)*(+gh)
= (*+++ab*c+def+gh)
Complexity classes All decision problems fall in sets of comparable complexity, called as complexity classes. The complexity class P is the set of decision problems which ca
Worst Fit method:- In this method the system always allocate a portion of the largest free block in memory. The philosophy behind this method is that by using small number of a ve
#question. merging 4 sorted files containing 50,10,25,15 records will take time?
Write an algorithm using pseudocode which takes temperatures input over a 100 day period (once per day) and output the number of days when the temperature was below 20C and the num
Z-Buffer Algorithm Also known as the Depth-Buffer algorithm, this image-space method simply selects for display the polygon or portion of a polygon that is nearest to the view
Define the term array. An array is a way to reference a series of memory locations using the same name. Each memory location is represented by an array element. An array eleme
In this respect depth-first search (DFS) is the exact reverse process: whenever it sends a new node, it immediately continues to extend from it. It sends back to previously explore
Mid Square method with good example
Sort the following array of elements using quick sort: 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8.
Write an algorithm, using a flowchart, which inputs the heights of all 500 students and outputs the height of the tallest person and the shortest p erson in the school.
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