6 - CMPSCI 187: Programming With Data Structures Lecture 6:...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPSCI 187: Programming With Data Structures Lecture 6: Collections and Abstract Stacks 19 September 2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Collections and Abstract Stacks • Catchup: Big-O time for three kinds of searches • The Collections Idea • Terminology: Data Types, Abstract Data Types, Data Structures • The Stack ADT in Java Terms, L&C’s StackADT Interface • Using a Stack: Searching for a Path as in Project #2 • Why Does the Search Algorithm Work?
Background image of page 2
The Collections Idea • As we said last time, a Collection is a set of objects of a common type. • Different kinds of Collection will support different operations to add objects, remove objects, or look at particular aspects of the objects. • In Discussion #1 the objects were containers and we kept them in two Collections, the stack and the buffer. • The key to deFning a kind of Collection is the interface between the user and the Collection -- what operations can the user request, and what will be their result, depending on the contents of the Collection?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Terminology: Data Types, ADT’s, and Data Structures • A data type is a set of values and accompanying operations, such as the eight primitive types in Java. The type of a variable that represents an object is the set of object classes that could legally be the value of that variable. • An abstract data type or ADT is a data type whose values and operations are given not by the language deFnition but by code. Here “abstract” means that the details of the implementation are hidden from the user. • An
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/22/2011 for the course COMPSCI 187 taught by Professor Barrington during the Fall '11 term at UMass (Amherst).

Page1 / 11

6 - CMPSCI 187: Programming With Data Structures Lecture 6:...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online