Class 15 Objectives


At the end of today's class you should

KNOW:

BE ABLE TO:

Sample Exam Question:

A binary search tree of persons is defined such that the tree is ordered alphabetically by the persons' names. Provide a data definition for such a BinarySearchTree. You may define a person any way you like for this problem, as long as your person data definition contains a component for a name and components for the left and right branches of the tree. Then, use the binary search tree property to design an efficient function that will satisfy the following signature and purpose:

;; in-tree?:  BinarySearchTree String -> Boolean
;; produces true if the person with the given name exists in the tree
(Hint: you may want to use the built-in Racket function string>? )