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
Initially Nodes are inserted in an AVL tree in the same manner as an ordinary binary search tree. Though, the insertion algorithm for any AVL tree travels back along with the pa

Sorting is significant application activity. Several sorting algorithms are obtainable. But, each is efficient for a specific situation or a specific kind of data. The choice of a

Consider the file " search_2013 ". This is a text file containingsearch key values; each entry is a particular ID (in the schema given above). You are tosimulate searching over a h

A binary tree in which if all its levels except possibly the last, have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is called as

What is Algorithm A finite sequence of steps for accomplishing some computational task. An algorithm should Have steps which are simple and definite enough to be done

Given the following search tree, state the order in which the nodes will be searched for breadth first, depth first, hill climbing and best first search, until a solution is reache

Your first task will be to come up with an appropriate data structure for representing numbers of arbitrary potential length in base 215. You will have to deal with large negative

write an algorithm for stack using array performing the operations as insertion ,deletion , display,isempty,isfull.

1)    The set of the algorithms whose order is O (1) would run in the identical time.  True/False 2)    Determine the complexity of the following program into big O notation:

an electrical student designed a circuit in which the impedence in one part of a series circuit is 2+j8 ohms and the impedent is another part of the circuit is 4-j60 ohm mm program