- If we use trees with the union-by-rank algorithm, what is the worst case running time for checking if two elements are in same set or not?
O(1)
O(n)
O(logN)
O(N^2)
Here because we have not applied path-compression, shouldn’t it be O(n)
- What is the maximum number of edges in the maximum matching of a bipartite graph with n vertices?
n
n^2
n/2
- Time Complexity Of Kruskals Algorithm(Here E is the number of edges and V are the number of vertices)
a) O(ElogV)
b) O(Elog√E)
c) O((V^2)log(E^2) + Elog(V^2)) d)
d) O(ElogE + Elog(V^2))
A, B are correct
Only A is correct
B, C, D are correct
A, B, D are correct
Only A should be correct.
- Q4. Topological Sort
What will be topological sort order of the following graph

5 4 2 3 0 1
5 4 2 3 1 0
5 4 2 0 1 3
5 2 3 1 4 0
Should’nt it be 5 4 2 0 1 3?
- How many undirected graphs (not necessarily connected) can be constructed out of a given set V= {V 1, V 2,…V n} of n vertices ?
(n(n-1))/2
n!
2^((n*(n-1))/2)
2^n
- What is the largest integer m such that every simple connected graph with n vertices and n edges contains at least m different spanning trees?
1
2
n
n-1
3
- How many simple undirected non-isomorphic graphs are there with 4 vertices?
8
32
4
64
