You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Use 'abstract' because we'll never create a TREE instance but will instead only create instances of INTERIOR_NODE and LEAF.
abstract int computeTreeSize(); // The subclasses of TREE need to define these methods.
abstract int countTreeNodes();
abstract int countLeafNodes(); // Note that computeTreeSize() = countInteriorNodes() + countLeafNodes(), but doing it that way would require TWO tree traversals.