| List I | List II |
|---|---|
| (A) Breadth First Search | (I) $\theta(V+E)$ |
| (B) Rabin-Karp Algorithm | (II) $O(V+E)$ |
| (C) Depth-First Search | (III) $\theta((n-m+1)m)$ |
| (D) Heap sort (worst case) | (IV) $O(n^2)$ |
| (E) Quick sort (worst case) | (V) $O(n\log n)$ |
Dijkstra's algorithm finds the shortest path based on minimum total weight.
It does not necessarily choose the path with the least number of vertices.
A path with more vertices can have smaller total weight than a path with fewer vertices.
Dijkstra's algorithm also requires all edge weights to be non-negative.
So, the statement “Shortest path always passes through least number of vertices” is not true.
Using the Fast Fourier Transform $($FFT$)$ method, polynomial multiplication can be done faster than the normal multiplication method.
Normal polynomial multiplication takes:
$\theta(n^2)$
But FFT based polynomial multiplication takes:
$\theta(n\lg n)$
Choose the correct answer from the options below:
Answer: 4) B and C only
When developing a dynamic programming algorithm, the sequence of steps followed is:
Choose the correct answer from the options given below:
Answer: (4) C, B, D, A
Explanation:
The standard steps for designing a dynamic programming algorithm are:
Hence, the correct order is C → B → D → A.
Select the Sorting Algorithms that are stable.
(A) Quick Sort
(B) Bubble Sort
(C) Insertion Sort
(D) Merge Sort
(E) Shell Sort
Choose the correct answer from the options given below :
Quick Sort → Not stable ✘
Bubble Sort → Stable ✔
Insertion Sort → Stable ✔
Merge Sort → Stable ✔
Shell Sort → Not stable ✘
Thus stable algorithms:
Bubble Sort, Insertion Sort, Merge Sort
But among given options, only
(B) and (C)
appear together correctly.
In the context of a Hamiltonian problem, which of the following are correct?
A. Hamiltonian cycle problem is NP-Complete
B. If $G$ is an undirected Bipartite graph with an odd number of vertices, then $G$ is Hamiltonian.
C. Hamiltonian path problem cannot be solved in polynomial time on directed acyclic graph
D. If $G$ is a connected undirected graph with at least three vertices and $G^3$ is the graph obtained by connecting all pairs of vertices that are connected by a path in $G$ of length at most $3$.
E. If any NP complete problem is polynomial time solvable the $(P=NP)$.
Choose the most appropriate answer from the options given below:
Statement A is true.
Hamiltonian cycle problem is NP-Complete.
Statement B is false.
A bipartite graph with odd number of vertices cannot have a Hamiltonian cycle.
Statement C is false.
Hamiltonian path problem can be solved in polynomial time for directed acyclic graph.
Statement D is true.
In graph power concept, $G^3$ connects vertices having distance at most $3$ in $G$.
Statement E is true.
If any NP-Complete problem is solved in polynomial time, then $P=NP$.
So, correct statements are A, D and E.
Correct option is:
$\boxed{(c)\ \text{A, D, E only}}$
Match List - I with List - II.
| List - I (Recurrence Relations) | List - II (Complexity) |
| (A) $T(n)=2T(n/2)+n$ | (I) $T(n)=\theta(n\log n)$ [exact solution] |
| (B) $T(n)=T(n/2)+1$ | (II) $O(n^2)$ |
| (C) $T(n)=2T(n/2)+1$ | (III) $T(n)=\theta(n)$ [exact solution] |
| (D) $T(n)=T(n-1)+1$ | (IV) $O(\log n)$ |
Choose the correct answer from the options given below :
(A) $T(n)=2T(n/2)+n$
Master theorem
$a=2,; b=2,; f(n)=n$
$\Rightarrow T(n)=\theta(n\log n)$
So (A) → (I)
(B) $T(n)=T(n/2)+1$
Divide size halves each step
$\Rightarrow T(n)=O(\log n)$
So (B) → (IV)
(C) $T(n)=2T(n/2)+1$
Master theorem
$\Rightarrow T(n)=\theta(n)$
So (C) → (III)
(D) $T(n)=T(n-1)+1$
Linear recurrence
$\Rightarrow T(n)=O(n)$
Closest option given:
(D) → (II)
Thus matching:
(A)-(I), (B)-(IV), (C)-(III), (D)-(II)
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.