CSE 2320 Notes 14: Graph Representations and Search
(Last updated 3/28/14 3:33 PM)
14.A. GRAPH REPRESENTATIONS
Sedgewick 3.7, 17.3, 17.4
Adjacency Matrices for dense E = V 2 classes of graphs
(A sparse graph is one whose number of edges is reasonably
CSE 2320 Notes 12: Red-Black Trees
(Last updated 3/24/14 4:20 PM)
Sedgewick 13.3-13.4
12.A. STRUCTURAL PROPERTIES
A red-black tree is a binary search tree whose height is (log n ) in the number of keys (n) stored.
1. Every node is colored red or black. (C
CSE 2320 Notes 1: Algorithmic Concepts
(Last updated 12/28/13 8:44 AM)
1.A. A SIMPLE ALGORITHMIC PROBLEM - MAINTAINING DISJOINT SUBSETS
Sedgewick 1.2 and 1.3
Abstraction:
Set of n elements: 0 . . n - 1
Initially all elements are in n different subsets
fin
CSE 2320 Notes 11: Rooted Trees
(Last updated 3/19/14 1:45 PM)
Sedgewick 5.4-5.7, 12.5-12.9
11.A. TREES
Representing Trees (main memory, disk devices in CSE 3330)
Binary tree
C
Key
Mandatory
Left Right
Left
Right
A
D
Optional
B
Parent
Key
Data
Subtree Siz
CSE 2320 Notes 6: Greedy Algorithms
(Last updated 1/2/14 11:03 AM)
6.A. CONCEPTS
Commitments are based on local decisions:
NO backtracking (will see in stack rat-in-a-maze - Notes 10)
NO exhaustive search (will observe in dynamic programming - Notes 7)
Ap
CSE 2320 Notes 4: Recurrences
(Last updated 12/30/13 11:21 AM)
Sedgewick 2.5
4.A. BOUNDING RECURRENCES ASYMPTOTICALLY
Goal: Take a function T ( n ) that is defined recursively and find f ( n ) such that T ( n ) ( f ( n ) .
Need to establish both T ( n ) (
CSE 2320 Notes 8: Sorting
(Last updated 2/27/14 11:30 AM)
8.A. QUICKSORT
Sedgewick 7.1-7.8
Concepts
Idea: Take an unsorted (sub)array and partition into two subarrays such that
p
q
y
x
r
z
yz
xy
Pivot
Customarily, the last subarray element (subscript r) i
1
CSE 2320 Notes 2: Growth of Functions
(Last updated 12/26/13 12:39 PM)
Sedgewick 2.1-2.3
Why constants are annoying . . .
Problem Instance of Size n (+ Constraints?)
Algorithm for Problem
Language
Compiler
Machine
clock
memory levels
word length
instruc
CSE 2320 Notes 7: Dynamic Programming
(Last updated 1/4/14 2:51 PM)
DYNAMIC PROGRAMMING APPROACH
1. Describe problem input.
2. Determine cost function and base case.
3. Determine general case for cost function. THE HARD PART!
4. Appropriate ordering for e
CSE 2320 Notes 5: Heapsort and Priority Queues
(Last updated 1/2/14 1:48 PM)
Sedgewick 9.1-9.6, 11.4
5.A. (BINARY) HEAP PROPERTIES
1. Binary tree.
2. Like a complete tree, but missing some rightmost leaves in deepest level.
3. a. Each parent has a priorit
Dynamic Growth & Double Hashing
Concept: When the load factor () reaches a fixed threshold, either (1) build a new double hash table
whose size is fractionally larger (n) than the old table (cn) or (2) build a new double hash table whose
size (n) is a fix