Question: Using the general tree ADT of Figure 6.2, write a function that takes as input the root of a general tree and returns a binary
Using the general tree ADT of Figure 6.2, write a function that takes as input the root of a general tree and returns a binary tree generated by the conversion process illustrated by Figure 6.14.


/** General tree ADT */ interface GenTree { public void clear(); public GTNode root (); // Make the tree have a new root, give first child and sib public void newroot (E value, GTNode first, GTNode sib); public void newleftchild (E value); // Add left child } // Clear the tree // Return the root Figure 6.2 The general tree node and general tree classes.
Step by Step Solution
3.47 Rating (150 Votes )
There are 3 Steps involved in it
Java class GTNode private E data private GTNode parent private GTNode firstChild private GTNode next... View full answer
Get step-by-step solutions from verified subject matter experts
