Graphs:
Traversals Shortest Path Minimum Spanning Trees Network Flow (and more graph stuff) and
Complexity
CS340: Data Structures and Algorithms Bouvier's Presentation based on PPTs by:
Rose Hoberman William White
Graph Reperesentations
2
Graphs
A graph G
CS 340
B-Trees
Dr. Gunes Ercal
Motivation
Disk storage is far greater than main memory.
BUT: Accessing disk is much more time
consuming than accessing main memory.
To search and access information from 1 GB of
disk, log2 109 ~ 30 may not be fast enough.
H
CS 340 Programming Assignment VII:
Single-Source Shortest Paths in generally Weighted graphs
Description: You are to implement both the DAG SP algorithm and the Bellman-Ford
algorithm for single-source shortest paths based on whether or not you detect a c
CS 340 Programming Assignment VI:
Two birds, one stone: Algorithms of Prim and Dijkstra
Description: You are to implement Prim's Algorithm for finding Minimum Spanning Trees
and Dijkstras Algorithm for single-source Shortest Paths for positively weighted
CS 340 Programming Assignment V:
Minimum Spanning Trees by Kruskal
Description: You are to implement Kruskal's Algorithm for finding Minimum Spanning Trees
(MSTs) of undirected positively weighted graphs adhering to the specifications detailed below.
I/O
CS 340 Programming Assignment IV:
Strongly Connected Components
Description: You are to implement the Depth-First Search (DFS) based algorithm for finding
the Strongly Connected Components of a directed graph, outputting the separate SCCs as
well as the t
CS 340 Programming Assignment III:
Topological Sort
Description: You are to implement the Depth-First Search (DFS) based algorithm for (i)
testing whether of not the input directed graph G is acyclic (a DAG), and (ii) if G is a DAG,
topologically sorting
CS 340 Project II:
Crossword Hunter
NOTE: This project includes a report as described under What to turn in.
For this project, you are provided a much larger dictionary of 776,521 words and
phrases that consists of just about every word and phrase one can
CS 340 Project I: Sorting (and Heaps)
Description:You are to implement InsertionSort, MergeSort, and HeapSort, including
the efficient linear time BuildHeap procedure for the latter. You are to use each of the
three sorting methods to sort subsets of give
Relations
A relation R on a set S maps every pair of elements in S to either TRUE or FALSE. For example, the greater than relation, >, is TRUE for the integer pair (5,3) (i.e., 5 > 3) but not for the pair (6,8) (since 6>8 is FALSE).
Chapter 8
Disjoint Set
CS 340
Similar to DP
Outline
Review/continue of DP discuss / examples Greedy algorithms
not an actual algorithm, but a class of algorithms
Intro to Greedy Algorithms
Two steps to dynamic programming
Formulate the answer as a recurrence relation or rec
CS 340
Similar to DP
Outline
Review/continue of DP discuss / examples Greedy algorithms
not an actual algorithm, but a class of algorithms
Intro to Greedy Algorithms
Two steps to dynamic programming
Formulate the answer as a recurrence relation or rec
Building Java Programs
Binary Search Trees
reading: 17.3 17.4
Binary search trees
binary search tree ("BST"): a binary tree where each non-
empty node R has the following properties:
elements of R's left subtree contain data "less than" R's data,
elemen