Write the following functions for a BST containing integer values (C++) double Average() //Calculates the average of th
Posted: Fri May 20, 2022 2:45 pm
Write the following functions for a BST containing integer values (C++)
double Average() //Calculates the average of the values of a BST. If the BST is empty, the method returns 0.
(hint: also implement the function “int averageRecursive(BSTNode node, int &count)” // the count variable is used to count the number of nodes visited.)
2.int minimum() //returns the minimum value in a BST. If the BST is empty, it returns 0.
double Average() //Calculates the average of the values of a BST. If the BST is empty, the method returns 0.
(hint: also implement the function “int averageRecursive(BSTNode node, int &count)” // the count variable is used to count the number of nodes visited.)
2.int minimum() //returns the minimum value in a BST. If the BST is empty, it returns 0.