1.

Which of the following tree traversals work if the null left pointer pointing to the predecessor and null right pointer pointing to the successor in a binary tree?(a) inorder, postorder, preorder traversals(b) inorder(c) postorder(d) preorderThe doubt is from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms II got this question during an interview.

Answer»

Correct choice is (a) inorder, postorder, preorder traversals

To explain: In threaded binary trees, the null left pointer POINTS to the PREDECESSOR and the right null pointer point to the successor. In threaded binary trees, we can USE in-order, preorder and postorder traversals to visit EVERY node in the tree.



Discussion

No Comment Found

Related InterviewSolutions