Question: The following code establishes a binary search tree and inserts the given values. There are two missing functions. One searches for a particular value in

The following code establishes a binary search tree and inserts the given values. There are two missing functions. One searches for a particular value in the tree and returns a pointer to the node containing that value (or NULL if the value is not found). The other function takes a pointer to the root of a tree, as well as a value, and returns the number of times the value occurs in the tree rooted at that root. How do I implement both of these functions into the given code? I am using Microsoft Visual Studio Express 2012 in C++.

The following code establishes a binary search tree and inserts the given

values. There are two missing functions. One searches for a particular value

in the tree and returns a pointer to the node containing that

D oe rees2pp-Microsof Visual Studio Express 2012 for Windows Deskiop Quick Launch (Cti+o IL[ CCIT ViCW PROJECT DOUG TLAM TOOLS TCST wINDCW IIELP more treas2cpp . nore trees2.cpp: Defines the entry point for the consale application #includo #include stdafx.h" using nanespace std; Astruct Node \ int data Node left; Node" right; Node* insert(Node root, int value) roo new Node0; root->data-value; ropt-left -NULL root->right = NULL ; else if (value data){ roul->left-inserLroul-lef, value); else t root->right- Insert root-ight, value); return rcot Evoid traverse (Node* reot) if (ro1-NULL traverse(rootleft); 100 2:01 AM 112/2017 Type here to search

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!