Evaluate the following prefix expression " ++ 26 + - 1324"
Answer Posted / vivek
take a stack and push operators into stack such as (*,+,_,/,etc) and when 2 operands(let a & B) appears pop out 1 operator and perform the expression (a operator B) and push it in 2 a stack
eg: ++2 6+-13 2 4
+(2+6) +-13 2 4
+8+(13-2)4
+8+11 4
+8(11+4)
+8 15
8+15
23 ans
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How much time does it take to learn data structures?
How do you find the depth of a binary tree?
What is sorting and classifying?
List the data structures which are used in network data modal.
Define linear probing?
What is data structure geeksforgeeks?
Complete structure of hashmap, very detail description, along with the basic coding of the hashmap internal implementation.
Which is faster quick sort or merge sort?
What is sequential search? What is the average number of comparisons in a sequential search?
What does list clear do?
How many links are there in a binary tree of N nodes?
In rdbms, explain what is the efficient data structure used in the internal storage representation?
What is a minimum spanning tree?
How does a treemap sort?
How do you find the space complexity of a bubble sort?