Implement a preorder inorder or postorderbinarytreeiterator


Project: Working With Binary Tree Representation

Complete the following exercises using the cs20::BinaryTree class presented in class.

1. Implement a PreOrder, InOrder or PostOrderBinaryTreeIterator using the BinaryTreeIterator class as the base class of the class you create.

2. Without using a BinaryTreeIterator, create a new method called isOnLeftSide that takes an Object value and determines if it is found on the left side of its parent node.  If the root of the tree is nullptr, your method should throw an InvalidTreeArgument exception.  The prototype for this method should be:

boolBinaryTree< Object >::isOnLeftSide( const Object & value ) throw( InvalidTreeArgument );

3.  Without using a BinaryTreeIterator, create a new method called findMax that takes no arguments and returns the maximum-valued Object found in this BinaryTree.  If the root of the tree is nullptr, your method should throw an InvalidTreeArgument exception.  The prototype for this method should be:

Object BinaryTree< Object >::findMax( ) throw ( InvalidTreeArgument );

Create a test driver that exercises each of these additional features, prints the tree and the results of each new operation.

Attachment:- Assignment.zip

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Implement a preorder inorder or postorderbinarytreeiterator
Reference No:- TGS01663458

Expected delivery within 24 Hours