1 / 5

Course Outline

Course Outline. Introduction and Algorithm Analysis (Ch. 2) Hash Tables: dictionary data structure (Ch. 5) Heaps: priority queue data structures (Ch. 6) Balanced Search Trees: general search structures (Ch. 4.1-4.5) Union-Find data structure (Ch. 8.1–8.5)

proy
Télécharger la présentation

Course Outline

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Course Outline • Introduction and Algorithm Analysis (Ch. 2) • Hash Tables: dictionary data structure (Ch. 5) • Heaps: priority queue data structures (Ch. 6) • Balanced Search Trees: general search structures (Ch. 4.1-4.5) • Union-Find data structure (Ch. 8.1–8.5) • Graphs: Representations and basic algorithms • Topological Sort (Ch. 9.1-9.2) • Minimum spanning trees (Ch. 9.5) • Shortest-path algorithms (Ch. 9.3.2) • B-Trees: External-Memory data structures (Ch. 4.7) • kD-Trees: Multi-Dimensional data structures (Ch. 12.6) • Misc.: Streaming data, randomization

  2. Minimum spanning tree 2 2 1 2 10 4 1 3 7 2 4 6 1 8 4 5 6 1 weight of tree = 16 • Connected, undirected graph with weights on edges • Spanning tree: connected, hits all nodes, has no cycles • MST = spanning tree of minimum total edge weight

  3. Cut theorem 2 2 10 4 1 1 3 2 7 2 4 8 4 5 6 6 1 1 • For any cut in the graph, the lowest-weight edge crossing the cut is in a MST. • (If ties, each lowest-weight edge is in some MST) • “Greed works.”

  4. Prim’s algorithm 2 2 1 2 10 4 1 3 7 2 4 6 1 8 4 5 6 1 T = one vertex, no edges for i = 1 to n-1 add the cheapest edge joining T to another vertex • very similar to Dijkstra’s shortest-path algorithm • implementation: priority queue (binary heap) of edges from known to unknown vertices • time: O( |E| log |V| )

  5. Kruskal’s algorithm 2 2 1 2 10 4 1 3 7 2 4 6 1 8 4 5 6 1 for i = 1 to n-1 add the cheapest edge that doesn’t create a cycle • implementation: priority queue (binary heap) of all edges • disjoint set union to detect cycles • time: O( |E| log |V| )

More Related