// Corey Williams // COP3530 01Z // Project 11 /* Write an application, that calls a recursive method, “shortestBranch” (i.e., must be written) and displays the depth to the shallowest node of the binary tree. */ /* Note - Project is incomplete - I had difficulty in returning what I believe to be the correct depth via the recursive shortestBranch function added in genBST11.h, but am submitting to show work done for partial credit.*/ using namespace std; #include #include "genBST11.h" #include int main() { vector inputs = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}; BST tree; for (auto i = inputs.begin(); i != inputs.end(); i++) { tree.insert(*i); } cout << "Nodes:\n"; tree.inorder(); cout << "\nThe shortest branch has " << tree.shortestBranch(tree.getRoot(), 1) << " nodes.\n"; }