Function that returns the height of a binary tree

Assignment Help C/C++ Programming
Reference no: EM1390370

Task 1: Fill out Survey

Please take the 122/223 survey at survey.osble.org/index.php?sid=97282. Please treat the question asking about 122 as if it were asking about taking 223. Note that this survey is different from the end of semester course evaluation survey. When you finish this survey, please have the TA check you off.

Task 2: Binary Search Tree Exercises

In the past, students often feel conceptually comfortable with BSTs, but often have difficulties actually using them in code. The following mini exercises are intended to give you exposure to working with BSTs in code. Inside of the BinarySearchTree class (look for the TODO items), complete the following functions:

1. Write a function called getHeight() that returns the height of a given binary tree.
a. Recall that the height is simply the maximum depth of the tree.

2. Write a function called getNumberOfLeafNodes() that returns the number of leaf nodes in the tree

3. Write a function called countSmallerThan() that returns the number of nodes whose values are smaller than the supplied input paramter

4. Write a function called outputRange() that returns, in sorted order, a string of nodes whose values are between a supplied range.

Sample Output

1332_sample output.png


Download:- starter_code.rar

Reference no: EM1390370

Questions Cloud

Probability on randomly selected phone number : The first three digits of a university telphone exchange are 452. if all the sequences of the remaining four digits are equally likely, what is the probability that a randomly selected universtiy phone number contains seven distinct digits?
Explain the levels of protein structure : Enzymes and proteins are essential to living organisms and function of a protein is dependent upon its structure. Discuss and describe the four levels of protein structure.
Calculate the overall proportion of tourists : Calculate the overall proportion of "tourists" (cars with out-of-state plates). b. Calculate the LCL and UCL for these data
Monte carlo simulation used to derive p-value for a cluster : Where does the p-value come from for the spatial scan statistic used in SaTScan? Explain how Monte Carlo simulation is used to derive a p-value for a cluster.
Function that returns the height of a binary tree : Write a function called getHeight() that returns the height of a given binary tree - CptS 122 Write a function called countSmallerThan() that returns the number of nodes whose values are smaller than the supplied input paramter
Estimate solute in the resulting solution : Molly requires to make one liter of a 1.5 M glucose solution for use in an experiment. The molar mass of glucose is 180.16 g/mol.
Calculate upper and lower control limits : Calculate upper and lower control limits for both sample means and ranges. Is this process in control? Explain--a simple Yes or No is insufficient
Explain different microbial groups in anaerobic digester : Describe what are the three different microbial groups in anaerobic digester, and how they work together to convert complex polymers to methane gas.
Probability of a right-handed golf player : A box of nine golf gloves contains two left-handed and seven right-handed ... box without replacement, what is the probability that- (X) both gloves are right handed and (Y) one left-handed and one ... If two gloves are randomly selected with repl..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd