Graphs-and-Tree
Question 1 |
S1:The sequence of procedure calls corresponds to a preorder traversal of the activation tree.
S2:The sequence of procedure returns corresponds to a postorder traversal of the activation tree.
Which one of the following options is correct?
S1is false and S2is false
| |
S1is true and S2is true | |
S1is true and S2is false | |
S1is false and S2is true |
The given statements are true, they are well known facts.
- The sequence of procedure calls corresponds to a preorder traversal of the activation tree.
- The sequence of returns corresponds to a postorder traversal of the activation tree.
Question 2 |
Let G = (V,E) be a directed, weighted graph with weight function w:E → R. For some function f:V → R, for each edge (u,v) ∈ E, define w'(u,v) as w(u,v) + f(u) - f(v).
Which one of the options completes the following sentence so that it is TRUE?
“The shortest paths in G under w are shortest paths under w’ too, _______”.
if and only if f(u) is the distance from s to u in the graph obtained by adding a new vertex s to G and edges of zero weight from s to every vertex of G | |
if and only if ∀u ∈ V, f(u) is positive
| |
if and only if ∀u ∈ V, f(u) is negative | |
for every f: V→R |


Question 3 |

Which of the following is/are correct about the graph?
For each pair of vertices u and v, there is a directed path from u to v. | |
The graph does not have a strongly connected component. | |
The graph does not have a topological order. | |
A depth-first traversal staring at vertex S classifies three directed edges as back edges. |
Option-1: FALSE: There is no path from top right corner vertex to any other vertex
Option-2: FALSE: A directed graph is called strongly connected if there is a path in each direction between each pair of vertices of the graph. As there is no path from the above vertex then this statement is wrong.
Option-3: TRUE: This graph does have directed cycles, thus topological order can not be possible for according to topological definition.

Question 4 |
v2v4 | |
v1v4 | |
v4v5 | |
v3v4 |
Question 5 |
Breadth first search; acyclic | |
Topological sort; acyclic | |
Breadth first search; cyclic | |
Topological sort; cyclic |
Question 6 |
Which one of the following is blind search?
Breadth first search
| |
Depth first search
| |
Breadth first search and Depth first search | |
None of the given options |
Examples of blind search algorithms are:
1. Depth First Search
2. Breadth First Search
3. Uniform Cost Search
Question 7 |
All successor of a visited node before any successors of any of those successors | |
A single path of the graph as far it can go | |
Graph using shortest path | |
None of these |