Hash Tables
10/4/2016
Presentation for use with the textbook Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Hash Tables
xkcd. http:/xkcd.com/221/. Random Number. Used with permission under Creative Commons 2.5 License.
1

Lists and Iterators
10/6/2016
Recursion vs Induction
CS3330: Algorithms
The University of Iowa
1
Recursion
Recursion means defining something, such as a
function, in terms of itself
For example, let f(x) = x!
We can define f(x) as
f(x) = if x < 2 then 1

Lists and Iterators
10/4/2016
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Fast Sorting and Selection
USGS NEIC. Public domain government image.
1
A Lower Bound for Worst Case
Th

Lists and Iterators
10/4/2016
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Merge Sort &
Quick Sort
1
Divide-and-Conquer
Divide-and conquer is a
general algorithm design
paradigm:

Lists and Iterators
10/24/2016
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Divide-and-Conquer
1
Application: Maxima Sets
We can visualize the various trade-offs for optimizing t

Priority Queues
10/4/2016
Presentation for use with the textbook Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Ch05 Priority Queues & Heapsort
1
Priority Queue ADT
A priority queue stores a
collection of elements which

Lists and Iterators
10/4/2016
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Union-Find Structures
1
Equivalence Relation
Relation R on S is a subset of SxS.
For every pair of elem

Lists and Iterators
10/25/2016
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Dynamic Programming
1
Dynamic Programming
Fibonacci sequence:
f1=1
f(n)
f2=1
1. if (n=1) or (n=2) th

B-Trees
10/4/2016 1:33 PM
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
B-Trees and External Memory
1
(2, 4) Trees
Each internal node has 2 to 4 children:
The number of data ite

Presentation for use with the textbook Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
Ch04 Balanced Binary
Search Trees
6
v
8
3
4
z
1
Why care about advanced implementations?
Same entries, different insertion sequence:

Lists and Iterators
10/18/2016
Presentation for use with the textbook, Algorithm Design and
Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015
The Greedy Method
1
The Greedy Method
The greedy method is a general algorithm
design paradigm, built