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?

Category: QuestionsWhich 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?
Editor">Editor Staff asked 4 weeks ago

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

1 Answers
Editor">Editor Staff answered 4 weeks ago

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.