Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

10.5. Exercises

  1. Write a recursive form of minimum().

  2. Write a recursive form of search().

  3. Write a method that takes a root node and recursively prints all the values of the tree in order.

  4. Write a method that takes a root node and iteratively prints all the values of the tree in order.

  5. Write a method that takes a root node and recursively prints all the values of the tree pre-order.

  6. Write a method that takes a root node and recursively prints all the values of the tree post-order.

  7. Write a method(s) that inserts values from a sorted list into a binary search tree in such a way as to maintain balance yet require no explicit balancing.

  8. Add method(s) to Node to recursively calculate its size.

  9. Add method(s) to Node to recursively calculate its height.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial