Conversion of general trees into the binary trees, Data Structure & Algorithms

By taking an appropriate example explain how a general tree can be represented as a Binary Tree.                                                                   

Conversion of general trees into the binary trees:

A general tree can be changed into an equivalent binary tree. This conversion process or technique is called the natural correspondence between general and binary trees.

The algorithm is written below:

(a) Insert the edges connecting siblings from left to right at the same level.

(b Erase all edges of a parent to its children except to its left most offspring.

(c) Rotate the obtained tree 450 to mark clearly left and right subtrees.

A general tree shown in figure (a) converted into the binary tree shown in (b)




Posted Date: 7/10/2012 1:15:53 AM | Location : United States

Related Discussions:- Conversion of general trees into the binary trees, Assignment Help, Ask Question on Conversion of general trees into the binary trees, Get Answer, Expert's Help, Conversion of general trees into the binary trees Discussions

Write discussion on Conversion of general trees into the binary trees
Your posts are moderated
Related Questions
Q. Calculate that how many key comparisons and assignments an insertion sort makes in its worst case?        Ans: The worst case performance occurs in insertion

Which are the two standard ways of traversing a graph? i. The depth-first traversal   ii. The breadth-first traversal

write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a

Q. What do you understand by the term sparse matrix? How sparse matrix is stored in the memory of a computer? Write down the function to find out the transpose of a sparse matrix u

Program: Program segment for insertion of an element into the queue add(int value) { struct queue *new; new = (struct queue*)malloc(sizeof(queue)); new->value = val

Board coloring , C/C++ Programming

Example of pre order traversal: Reading of a book, since we do not read next chapter unless we complete all sections of previous chapter & all its sections. Figure  : Rea

Link list representation of a circular queue is more efficient as it employs space more competently, of course with the added cost of storing the pointers. Program 7 gives the link

Algorithm for insertion of any element into the circular queue: Step-1: If "rear" of the queue is pointing at the last position then go to step-2 or else Step-3 Step-2: make

What do you understand by structured programming Structured Programming  This term is used for programming design that emphasizes:- (1) Hierarchical design of programmi