Question
include code that verifies that the BinarySearchTree meet these requirements: 1) The Binary Search Tree ADT is extended to include a boolean method similarTrees that
include code that verifies that the BinarySearchTree meet these requirements:
1) The Binary Search Tree ADT is extended to include a boolean method similarTrees that receives references to two binary trees and determines whether the shapes of the trees are the same. (The nodes do not have to contain the same values, but each node must have the same number of children.)
a) Write the declaration of the similarTrees method. Include adequate comments.
b) Write the body of the similarTrees method.
2) Extend the Binary Search Tree ADT to include a public method singleParentCount that returns the number of nodes in the tree that have only one child.
3) Extend the Binary Search Tree ADT to include a public method leafCount that returns the number of leaf nodes in the tree.
all I need is code to verify that these modifications would work. Thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started