Current CS502 Paper MidFall2019
Cs502 Divide and conquer (3) Catalan number(5) Chain matrix multiple cation (5) Bubble sort(5) Property of algorithms (3) McQ from handout CS502 Today's Mid Term Paper MCQ's Mostly from pastpers 2 qs marks 3 and 3 qs marks 5 1.Sorting and write its types..5 marks 2. Counting sort numbers are given.. 5 marks 3.Any Program.. i don't know this qs..5 marks 4. Edit Transcript.. 3 marks 5. Upper bound and lower boundCS502 Quiz 2 Solution and Discussion

In strong components algorithm, first of all DFS is run for computing finish times of vertices. CS502
 True Page No.138
 False
This is presented in Figure 8.37. Recall that the component DAG consists of super vertices.

In strong components algorithm, first of all DFS is run for computing finish times of vertices. CS502
 [d[u], f[u]]⊆[d[v], f[v]]
 [d[u], f[u]]⊇[d[v], f[v]]
 unrelated Page No.129
 Disjoint
The ancestor and descendent relation can be nicely inferred by the parenthesis lemma. u is a descendent of v if and only if [d[u], f[u]]⊆[d[v], f[v]]. u is a ancestor of v if and only if[d[u], f[u]]⊇[d[v], f[v]]. u is unrelated to v if and only if[d[u], f[u]]and[d[v], f[v]]are disjoint. The is shown in Figure 8.26. The width of the rectangle associated with a vertex is equal to the time the vertex was discovered till the time the vertex was completely processed (colored black). Imagine an opening parenthesis ‘(’ at the start of the rectangle and and closing parenthesis ‘)’ at the end of the rectangle. The rectangle (parentheses) for vertex ‘b’ is completely enclosed by the rectangle for ‘a’. Rectangle for ‘c’ is completely enclosed by vertex ‘b’ rectangle.

For traversing graphs, Breadthfirst search can be visualized as a wave front propagating inwards towards root (or source) node. CS502
 True
 False Page No.117
Breadthfirst Search:
Here is a more efficient algorithm called the breadthfirst search (BFS) Start with s and visit its adjacent nodes. Label them with distance 1. Now consider the neighbors of neighbors of s. These would be at distance 2. Now consider the neighbors of neighbors of neighbors of s. These would be at distance 3. Repeat this until no more unvisited neighbors left to visit. The algorithm can be visualized as a wave front propagating outwards from s visiting the vertices in bands at ever increasing distances from s. 
Digraphs are not used in communication and transportation networks. CS502
 True
 False Page No.135
Strong Components:
We consider an important connectivity problem with digraphs. When diagraphs are used in communication and transportation networks, people want to know that their networks are complete. 
You have an adjacency list for G, what is the time complexity to compute Graph transpose G^T.? CS502 ?
 (V + E) Page No.138
 V E
 V
 E
We will discuss the algorithm without proof. Define GT to be the digraph with the same vertex set at G but in which all edges have been reversed in direction. This is shown in Figure 8.38. Given an adjacency list for G, it is possible to compute G Tin Θ (V+E) time.

In computing the strongly connected components of a digraph, vertices of the digraph are not partitioned into subsets. CS502
 True
 False Page No.135
We partition the vertices of the digraph into subsets such that the induced sub graph of each subset is strongly connected.

There are no ________ edges in undirected graph. CS502
 Forward
 Back
 Cross
 Both Forward and Back Page No. 130
For undirected graphs, there is no distinction between forward and back edges. 
We say that two vertices u and v are mutually not reachable if u can reach v and vice versa. CS502
 True Page No. 135
 False
A digraph is strongly connected if for every pair of vertices u, v∈V,u can reach v and vice versa.