SUNY Geneseo Department of Computer Science


Introduction to Trees

{Date}

CSci 141, Fall 2004
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

Hand out Lab 10

Questions?

Timing Fast Operations

e.g., how long does it take to compute the length of a list?

See section 9.3 in text

Developed a Program that does such timing

Inherent +/- 1 count error in discrete time measurements

[Times Can Measure Up to 1 Tick Too Long, or 1 Tick Too Short]

Introduction to Trees

Reading summary -- Sections 13.1 and 13.2

[Root Adds One Level Above those in Subtrees]

Formal definition of "binary tree"

Binary tree messages?

Binary Tree Algorithms

Print all the items in a binary tree

    // In some subclass of BinaryTree
    void print() {
        if this.isEmpty()
            do nothing
        else
            print this.getRoot()
            this.getLeft().print()
            this.getRight().print()

Next

Trees and searching

Read Sections 13.3.1 and 13.3.2


Next Lecture