BinaryTree to Map
Create a method
toMap that accepts a
BinaryTree<*> and returns a
mapping the values in the tree to the count of the times that the value appears.
Our suggestion is to have
toMap create the map and then call a private recursive helper method to populate it.
You will need to import
We've provided some code to get you started.
cs125.trees.BinaryTree is defined like this:
Note that you may need to cast
Any so that you can add it to your map.