Let LASTPOST, LASTIN and LASTPRE denote the last vertex visited in a postorder, inorder and preorder traversal respectively of a complete binary tree. Which of the following is always true?
A
LASTIN = LASTPOST
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
LASTIN = LASTPRE
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
None of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
LASTPRE = LASTPOST
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution
The correct option is B LASTIN = LASTPRE
Because of complete binary tree option (b) is always correct