Exercise 22 in the previous chapter asked you to develop an interface General Tree Interface for a general tree. Write the class General Tree that implements General Tree Interface. a. Use a binary...


Exercise 22 in the previous chapter asked you to develop an interface General Tree Interface for a general tree. Write the class General Tree that implements General Tree Interface. a. Use a binary tree to represent the general tree, as described in Segment 25.19. Implement iterators for the preorder and postorder traversals. As an extra challenge, implement an iterator for the level-order traversal. b. Repeat Part a, but do not use a binary tree. Instead, define the class GeneralNode that implements the interface GeneralNodeInterface, as given in Listing 25-6. Use GeneralNode objects to define a general tree.

Nov 24, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here