CSC 151.01, Class 27: Trees
Overview
- Preliminaries
- Notes and news
- Upcoming work
- Extra credit
- Questions
- Lab
- Debrief
News / Etc.
- Folks had enough difficulty on this assignment that I plan to discuss it next week, probably on Wednesday.
Upcoming Work
- Writeup for class 26 due TONIGHT at 10:30 p.m.
- Exercise 5. (No documentation necessary, but appreciated.)
- To: csc151-01-grader@grinnell.edu
- Subject: CSC 151.01 Writeup 26 (YOUR NAMES)
- No writeup for class 27.
- Assignment 7 due next Tuesday.
- Not quite in perfect shape.
- Read Higher-order procedures for Friday’s class.
- Yes, it’s ready!
- Big picture
- HW 7 due next 7 Nov. (Tuesday)
- Exam 3 due 14 Nov. (Tuesday)
- Project proposal due 20 Nov. (Monday!)
- Project due 28 Nov. (Tuesday)
- Project presentations Dec. 4 and 6.
- Exam 4 due 5 December.
- Optional final during finals week (any of the three CSC 151 exam times will be fine)
Extra credit (Academic/Artistic)
- Rebirth Brass Band, TONIGHT at 7:30 p.m. in Herrick.
- Scholars Convocation TOMOORROW at 11:00 a.m. in JRC 101.
- CS Extras, Thursday at 4:15 p.m.: “Building your own programming language and other reasons to go to graduate school”
- Leyla McCalla Trio, Nov. 6, Herrick
Extra credit (Peer)
- Pop up exhibition Friday 7-10 p.m., Food house. 1128 East Street,
behind Cleveland.
- EC for submitting
- EC for attending
- But not both
Extra credit (Misc)
Other good things
Questions
Lab
Note: vector->tree only creates a binary search tree when the original
vector is in alphabetical order. Exercise 7 encourages you to explore
that issue. (The bug in exercise 6 also suggested that error.)
Note: vector->tree has a slight bias toward choosing the thing on the
left. That means there will be more things on the right.
Please rearrange the original vector so that “Samuel” precedes “Sarah”. Whoops!
NO LAB WRITEUP.
Debrief
If we are fortunate enough to have a binary search tree, bst-find is
much faster than tree-contains?. But we do need a binary search tree.
tree-contains? looks at the whole left subtree before it looks at the
whole right subtree. It turns out to be hard to write tree-contains?
so that it looks at everything on the same level before going on to the
next level.