SUNY Geneseo Department of Computer Science


Introduction to Trees

{Date}

CSci 141, Spring 2005
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Questions?

Etiquette for changing others code?

Trees

Sections 13.1 and 13.2

Formal definition of "binary tree"

Common binary tree messages

Algorithm to print each element in a binary tree

    // In some subclass of Tree...
    printTree()
        if ! this.isEmpty()
            print this.getRoot()
            this.getLeft().printTree()
            this.getRight.printTree()
        else
            print "empty"

Next

Ordered trees

Read Section 13.3 through 13.3.4


Next Lecture