Homework #5 Solution




This homework is NOT a programming homework. The submission MUST be in PDF format. You are recommended to use Google Docs to plot the figures online. Do NOT plot it by handwriting and scan it. It is also OK if you choose to use PowerPoint, Visio, or similar tools to plot figures. But your submission must be in PDF.


Question 1:


Suppose we have the following numbers, 1, 2, 3, 4, 5, 6, and 7 (order does not matter here). Build 1) a binary search tree that has the minimum height and 2) the binary search trees that has the maximum height (two cases)



Question 2:


There is a sequence of numbers: {50,76,21,4,32,64,15,52,14,100,83,2,2,70,87,80}. Suppose you have an empty binary search tree then add the numbers one by one from the sequence in order.






Usage of Google Docs


  1. Go to docs.google.com and log in with your csueastbay email account.


  1. Start a new document


  1. In the started document, File-> New->Drawing


  1. Then you can draw the tree. The nodes of the tree should be a rectangle or cycle from Shape. The nodes must be linked by using lines


  1. When you are done, you need to File->Download->PDF to download it as a PDF file.


  1. Finally, submit the PDF file to BlackBoard.




  1. [5%] The Following identification information must be included at the beginning of your cpp file.




//Email: XXXX@csueastbay.edu


  1. [5%] Must be plotted on computers not handwritten.


  1. [45%] Question 1


  1. [45%] Question 2

error: Content is protected !!