Lecture 19

Learning objectives

After this class, you should be able to:

  1. Given the figure of a graph, give its adjaceny matrix and adjacency list representations. Also give the memory requirement for each and time required for performing common operations, such as checking if an edge is present or traversing the set of all edges.
  2. Prove the correctness of the Breadth First Search and Depth First Search algorithms and explain their time complexities.
  3. Given a graph and a vertex, show the order in which nodes are visited in Breadth First Search and Depth First Search of the graph starting from that vertex.

Reading assignment

  1. CLR: Sections 22.1-3.

Exercises and review questions


Last modified: 3 Nov 2015