Write classes that implement the general tree class declarations of Figure 6.2 using the linked general tree

Question:

Write classes that implement the general tree class declarations of Figure 6.2 using the linked general tree implementation with child pointer arrays of Figure 6.12.

/** General tree ADT */ interface GenTree { public void clear (); // Clear the tree. public GTNode root ();

Your implementation should support only fixed-size nodes that do not change their number of children once they are created.

A R B Val Size R 2 F A 3 C D) (E (a) (b) Figure 6.12 A dynamic general tree representation with fixed-size

Then, reimplement these classes with the linked list of children representation of Figure 6.13. How do the two implementations compare in space and time efficiency and ease of implementation?

R A B I I D) (E F  A R - B ME-NE-Z in  D E F (a) (b) Figure 6.13 A dynamic general tree representation with

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: