SUNY Geneseo Department of Computer Science


Stacks

{Date}

CSci 141, Fall 2004
Prof. Doug Baldwin

Return to List of Lectures

Previous Lecture


Misc

Exam 2 is next Tuesday, Nov. 9

Hand out Lab 9

Questions?

Stacks

Reading summary

An alternative implementation of stacks

[Objects' Interfaces Determine their Class]

    class Stack
        private List data
        push( x )
            data.addItem(x)
        pop()
            return data.getAndRemove()
        isEmpty()
            return data.isEmpty()

[An Adaptor Changes an Object's Interface]

Stack applications

Next

Introduction to trees

Read sections 13.1 and 13.2


Next Lecture