Question: In C++, you will need to write the following three functions in table.cpp, and add function prototypes for them to table.h. File supplied.o contains code

In C++, you will need to write the following three functions in table.cpp, and add function prototypes for them to table.h. File supplied.o contains code that can build, display, duplicate, and destroy a binary search tree

int count(node * root) Recursively compute and return the number of nodes in the bst.

int sum(node * root) Recursively compute and return the sum of the ints contained in the bst.

int height(node * root) Recursively compute and return the height of the bst

-----------------------

Given:

---------

table.h

//list.h #include #include #include using namespace std;

struct node { int data; node * left; node * right;; };

void build(node * & root); //supplied void display(node * root); //supplied void destroy(node * & root); //supplied

/* ************** PLACE YOUR PROTOTYPE HERE ***************** */

----------------

main.cpp

#include "table.h"

#include

using namespace std;

int main() { node * root = NULL; build(root); display(root);

/* PLACE YOUR FUNCTION CALL HERE */

display(root); destroy(root); return 0; }

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!