















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!
















wasted space: the leaf nodes each have 2 null pointers
help us in inorder traversals and postorder traversals.
Structure of a node
node *left, *right; int data; bool leftThread, rightThread; }
1 5 0
Example of Threaded Tree
Only right links are shown for simplicity.
Follow thread to right, print node
Output 1 3
Follow link to right, go to leftmost node and print
Output 1 3 5
Follow link to right, go to leftmost node and print
Output 1 3 5 6 7
Follow thread to right, print node
Output 1 3 5 6 7 8
Follow thread to right, print node
Output 1 3 5 6 7 8 9
11
Follow link to right, go to leftmost node and print
Output 1 3 5 6 7 8 9
11 13
T
S
T
S