This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Trees Margaret M. Fleck 31 March 2010 We’ve seen trees already, but informally. This lecture firms up the details of trees and tree terminology (section 10.1 of Rosen). 1 Announcements Midterm coming up next Wednesday (the 7th). As for the first midterm, discussions that week and Wednesday’s lecture will be exam review. There will be no homework due Friday after the exam. Office hours are changed to: • Monday: Margaret 10am • Tuesday: Viraj 3-5pm • Wednesday: Samer 11-12, Chen 3:30-4:30, Andrew 4-5 • Thursday: none • Friday: Margaret 11am Quizzes were returned. Unclaimed quizzes are in the TA office and can be collected at office hour. There is a small but important bug on homework 8. See newsgroup or the homework web page for the patch. 1 2 Why trees? Computer scientists are obsessed with trees, because trees of various sorts show up in a wide range of contexts. Originally, of course, trees are a familiar form of plant. Oddly, computer scientists normally draw ours upside down. [smile] Trees in computer science show up as • Organization of real-world data: family/geneaology trees, taxonomies (e.g. animal species) • Data structures for efficiently storing and retrieving data. The basic idea is the same one we saw for binary search within an array: sort the data, so that you can repeatedly cut your search area in half. • Parse trees, which show the structure of a piece of (for example) com- puter program, so that the compiler can correctly produce the corre- sponding machine code....
View Full Document
- Spring '10
- Graph Theory