CS 141 - Lab 7

Breadth First Search

Directions

Find a partner. Solve the following programming problem in C++. When you finish, turn it in electronically, one copy per team. When you are done, you should work on Homework 4 or Programming Assignment 4.

Overview

Fill in the blanks in the provided skeleton code to implement breadth-first search on a directed graph.

Details

Download lab7.cc. Read through the comments to get an overview of what you are required to do. Then, follow the comment directions to fill in the blanks. You need to do most of the input routines to fill in the adjacency-list, and much of the search. Output and basic logic has been taken care of for you.

Testing

Test cases can be found here. Run these using regular UNIX redirection & testing:
./lab5 < inputFile | diff - outputFile 
Where inputFile and outputFile will be a pair of these:
lab7test1.in lab7test1.out
lab7test2.in lab7test2.out
lab7test3.in lab7test3.out