Stacks
O tline Outline
The Stack ADT Applications of Stacks Array-based implementation Growable array based stack array-based
Stacks
2
Abst act Data T pes (ADTs) Abstract Types
An abstract data type (ADT) is an abstraction of a data t t d t structure An A
Analysis of Algorithms
Input
Algorithm
Output
An algorithm is a step-by-step procedure for solving a problem in a finite amount of time.
Running Time (3.1)
Most algorithms transform input objects into output objects. The running time of an algorithm typic
Trees
9/21/2007 8:11 AM
Trees
1
Outline and Reading
Tree ADT (6.1) Preorder and postorder traversals (6.2.3) BinaryTree ADT (6.3.1) Inorder traversal (6.3.4) Euler Tour traversal (6.3.4) Template method pattern (6.3.5) Data structures for trees (6.4)
9/21
Vectors
9/14/2007 2:55 PM
Vectors
1
Outline and Reading
The Vector ADT (5.1.1) Array-based implementation (5.1.2)
9/14/2007 2:55 PM
Vectors
2
The Vector ADT
The Vector ADT stores objects to which it provides direct access An element can be accessed, inser
Dictionaries and Hash Tables
0 1 2 3 4
025-612-0001 981-101-0002
451-229-0004
Dictionaries and Hash Tables
1
Dictionary ADT (8.1.1)
The dictionary ADT models a searchable collection of keyelement items The main operations of a dictionary are searching, in
Heaps and Priority Queues
2 5 9 7 6
Heaps and Priority Queues
1
Priority Queue ADT (7.1)
A priority queue stores a collection of items An item is a pair (key, element) Main methods of the Priority Queue ADT
insertItem(k, o) inserts an item with key k and
AVL Trees
6
v
3
8
z
4
AVL Trees
1
AVL Tree Definition (9.2)
AVL trees are balanced. An AVL Tree is a
4 44 2 17 1 32 1 48 62 2 50 1 88 78 1 3
binary search tree
such that for every internal node v of T, the heights of the
children of v can differ by at mos