CS 503, Advanced Programming I

Quiz 4, 21 March 2006


  1. A colleague of yours asks you to point to one of three identical wallets on a table, telling you that two of the wallets are empty and the third contains a 10-dollar bill, which you may keep if you pick the wallet containing it. After you chose your colleague picks one of the remaining wallets and shows you that it's empty. Your colleague then asks you if you'd like to change your mind and pick the remaining wallet or stick with your original choice. Draw a tree (not necessarily binary) to help determine what you should do.



  2. Give an example text and command that would produce the following n-neighbor tree:

    an example n-neighbor tree



  3. Show that a binary tree with n > 0 nodes also has n - 1 edges.



  4. Which of the traversals of a binary search tree visits each node in increasing order of the data held at each node?


    See Nyhoff page 671.



This page last modified on 10 April 2006.