SUNY Geneseo Department of Computer Science


Motivation for Trees

{Date}

CSci 240, Spring 2007
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture

Misc

Hour Exam 2

Problem Set 11 due today

Questions?

Recurrences for Master Theorem

[a = Number of Recursions, b = Divisor in Recursion, g(n) = Work Other than Recursion]

Word Counting, Revisited

Idea for a really fast word counter (already explored by some of you)

        class WordRecord {
            public String text;
            public int occurrences;
        }

But...

        while not at end of file
            String word = file.next()
            search data set for a record containing this word
            if search succeeds, record is r
                r.occurrences = r.occurrences + 1
            else
                add new WordRecord(word,1) to data set

Want a data structure that supports

[

Next

(After exam)

Tree terminology, properties, etc.

Read Chapter 13 to but not including Section 13.3.2


Next Lecture