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
Can a stack be described as a pointer? Explain.
How do you define a set?
How do you declare An array of three pointers to chars
Is arraylist a list?
Can arraylist hold different types?
What is linked list ?
What is complete binary tree and almost complete binary tree?
What are lists?
How do you find the depth of a binary tree?
When is a binary search algorithm best applied?
How is a hashset implemented?
Why you need a data structure?
Does hashset maintain order?
Run time memory allocation is known as in data structure?
What do you mean by level of the tree?