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
The doubt is from Threaded Binary Tree in portion Binary Trees of Data Structures & Algorithms I
I got this question during an interview.
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.