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.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here