CPSC 110 Lecture 11: CPSC Lecture 11.docx

151 views2 pages
28 Aug 2014
School
Course
Professor
ferrari12 and 39375 others unlocked
CPSC 110 Full Course Notes
23
CPSC 110 Full Course Notes
Verified Note
23 documents

Document Summary

List, bst (list 3 2 1) = (list 3 2 1) Append appends 2 lists (append (list 1 2 3) (list 5 7 8)) = (list 1 2 3 5 7 8) Cons will add an element to your list (cons 0 (list 1 2 3)) = (list 0 1 2 3) : something that never varies, makes sure your tree is ok. Invariant (left/right subtrees are > or < than the mom) e. g. ;; invariant for a given node. ;; key is > htan all keysin the left subtree. ;; key is < than all keys in the right subtree. ;; the same key never appears twice in the tree (lookup-key t k) : t is bst (the tree you are searching in) , k is the key you"re searching for . Template changes when you have an extra (atomic distinct) k to work with: Changes from (define (fn-for-bst t) (cond [(false? t) ()]

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions