Question: Given the following partial definition for class that implements a binary tree: public class IntBinaryTree class Node ( int data Node left, right: private Node
Given the following partial definition for class that implements a binary tree: public class IntBinaryTree class Node ( int data Node left, right: private Node root: 10. Complete the method leafCount so that it returns the number of leaf nodes within the tree. What is the Big-O for your code. Explain. Partial credit for pseudo-code. public int leafCount) 11. Complete the method maxValue so that it returns the maximum value within the tree. What is the Big-O for your code. Explain. Partial credit for pseudo-code. public int maxValue )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
