wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following new - order strategy for traversing a binary tree:

The New - order traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5 - 2 ^ 6 7 * 1 + - is given by

A
- + 1 * 7 6 ^ 2 - 5 * 4 3
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
+ - 1 6 7 * 2 ^ 5 - 3 4 *
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
- + 1 * 6 7 ^ 2 - 5 * 3 4
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
1 7 6 * 2 5 4 3 * - ^ -
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A - + 1 * 7 6 ^ 2 - 5 * 4 3
The expression is given in reverse polish notation i.e., post order.

Expression is 3 4 * 5 - 2 ^ 6 7 * 1 + -

Expression tree for above post order expression is


From the above expression tree NEW ORDER traversal is - + 1 * 7 6 ^ 2 - 5 * 4 3

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Why Divisibility Rules?
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon