Threaded Binary Tree, Data Structure & Algorithms

If a node in a binary tree is not containing left or right child or it is a leaf node then that absence of child node can be represented by the null pointers. The space engaged by these null entries can be utilized to store any kind of valuable information. One possible way to utilize or use this space is to have special pointer that point to nodes higher in the tree that is ancestors. Such special pointers are called threads and the binary tree having such pointers is called as threaded binary tree. There are various ways to thread a binary tree each of these  ways  either  correspond  either  in-order  or  pre-order  traversal  of  T. A Threaded Binary Tree is a type of binary tree in which every node that does not have a right child has a THREAD (or a link) to its INORDER successor. By doing this threading we avoid the recursive method of traversing a Tree, which makes use of stacks and wastes a lot of time and memory.

The node structure for a threaded binary tree differs a bit and its like this

struct NODE


struct NODE *leftchild;

int node_value;

struct NODE *rightchild;

struct NODE *thread;


The Threaded Binary tree made from normal binary tree...

2066_Threaded binary tree.png

The INORDER traversal for the above drawn tree is -- D B A E C. Then the respective

Threaded Binary tree will be --

1538_Threaded binary tree1.png

B does not have right child and its inorder successor is A and so a thread has been made in between them. Likewise, for D and E. C have no right child but it has no inorder successor even, therefore it has a hanging thread.

Posted Date: 7/10/2012 3:35:44 AM | Location : United States

Related Discussions:- Threaded Binary Tree, Assignment Help, Ask Question on Threaded Binary Tree, Get Answer, Expert's Help, Threaded Binary Tree Discussions

Write discussion on Threaded Binary Tree
Your posts are moderated
Related Questions
Pre-order Traversal The method of doing a pre-order traversal iteratively then has the several steps(suppose that a stack is available to hold pointers to the appropriate nodes

As we have seen, as the traversal mechanisms were intrinsically recursive, the implementation was also easy through a recursive procedure. Though, in the case of a non-recursive me

Ask queConsider the following functional dependencies: Applicant_ID -> Applicant_Name Applicant_ID -> Applicant_Address Position_ID -> Positoin_Title Position_ID -> Date_Position_O

State the Introduction to pseudocode No specific programming language is referred to; development of algorithms by using pseudocode uses generic descriptions of branching, loop

A LGORITHM (Deletion of an element from the linked list) Step 1  Begin Step 2  if the list is empty, then element cannot be deleted Step 3  else, if the element to be del

write an algorithm given each students name and grade points for six courses.find his grade point average and group students into the gpa groups 3.5

Q. Write down the algorithm which does depth first search through an un-weighted connected graph. In an un-weighted graph, would breadth first search or depth first search or neith

Define tractable and intractable problems Problems that can be solved in polynomial time are known as tractable problems, problems that cannot be solved in polynomial time are

Determine about the push operation A Container may or may not be accessible by keys, so it can't make assumptions about element retrieval methods (for example, it cannot have a

Mid Square method with good example