what are threaded binary trees and adavantages
DESCRIPTION
TYTRANSCRIPT
1. What are threaded binary trees? What are the advantages and disadvantages of threaded binary trees over binary search trees?
A Threaded Binary Tree is a binary tree in which every node that does not have aright child has a THREAD (in actual sense, a link) to its INORDER successor. Bydoing this threading we avoid the recursive method of traversing a Tree, whichmakes use of stacks and consumes a lot of memory and time.The node structure for a threaded binary tree varies a bit and its like this --
Code:
struct NODE{struct NODE *leftchild;int node_value;struct NODE *rightchild;struct NODE *thread;}
Advantage1. By doing threading we avoid the recursive method of traversing a Tree , which makes use of stack and consumes a lot of memory and time .2 . The node can keep record of its root .Disadvantage1. This makes the Tree more complex .2. More prone to errors when both the child are not present & both values of nodespointer to their ansentors .