Write the following method for the Binary Tree class
-
find maximum value
- Arguments: none
- Returns: number
- Find the maximum value stored in the tree. You can assume that the values stored in the Binary Tree will be numeric.
-
Write out problem statement
-
drew it out first because I didn't get it
-
looked at binary tree code for help
-
create find max function
-
use in order to return list values and loop through them for comparison
-
The Big O time is O(n) where n is number of nodes in tree and iterates over all nodes once. Space: O(n) because it stores all nodes using in order traversal
