CSCI 2300 Lab 5, Fall 2014, 10/08/2014

This lab is about graphs and algorithms. You are encouraged to start working on the lab ahead of time. It may be time consuming.
  1. Using a DFS procedure to the Graph Class (Sample) and Sample Data (input) for unweighted graph. test whether a given graph is a tree or not. You can assume that the given graph is connected. DFS on Undirected Graph Code - Please read the code and understand and adapt it for this problem.
  2. Using a DFS procedure, for the given input directed graph find the topological sorted numbers. (You can still use Graph.cc (Graph Class) and your dfs procedure.) You may assume that there is exactly one source vertex (that is one vertex with in-degree 0 and that will be ths starting vertex.)
  3. In class (10/2/2014), I mentioned about the maximum number of edges in a digraph(directed graph) with n different strongly connected components is n(n-1)/2. (Draw a complete undirected graph with n nodes labelled {1,2,3,...,n} and draw a directed edge from node i to node j if j is > i . Such a directed graph is acyclic and has n strongle components.) Your problem is to find the maximum number of edges with 2 strongly components for a directed graph with 6 vertices. (Optional problem to generalize with n vertices directed graph)
  4. (Motivated by Test 1 Grading) Implement Binary Search Algorithm in C++ (both using recursion and iteration) to find whether a number exists in a given sorted list of numbers. Also implement uniform Binary Search Algorithm in C++ . Unifrom Binary Algorithm in given here here - This page includes a C implementation. Please read this blog post about bugs in binary search
  5. Here is a strongly connected component finding program in C++ . Using this program find strongly connected components of the problem in 3.4 (i) and 3.4 (ii)