I: Insertion sort runs faster than merge sort if input sequences are already sorted.
II: Heap sort and selection sort time complexity will not depend on input sequence.
III. Heap sort and Quicksort are not stable algorithms
S1= √n logn
S2= (logn)^2
S3= n^0.4
Which of the following statements is represented asymptotically correct?
void Bob()
{
int i,j,k;
for(i=0; i<n*n; i++)
for(j=0; j<i; j++)
printf(“GATE 2021”);
for(k=0; k<n*n; k++)
for(m=0; m<k*k; m++)
printf(“GATE 2021”);
}

int Bob(int a,int n)
{
int n,x;
if(n==0)
return 1;
else
x=Bob(a,⌊n/2⌋)
if((n%2)!=0)
return a*x*x;
else
return x*x;
}
I. Primary Clustering is the tendency for a collision resolution scheme such as _______to create long runs of filled slots near the hash position of keys.
II. Secondary Clustering is the tendency for a collision resolution scheme such as _______to create long runs of filled slots away from the hash position of keys.

Insert the element 55 after constructing the max heap and Find the value of index 5 is _?
[ Hint: Index of an array starts with 0 ]
Job
|
A
|
B
|
C
|
D
|
E
|
F
|
Start Time
|
2
|
3
|
1
|
6
|
7
|
8
|
End Time
|
3
|
7
|
4
|
9
|
11
|
12
|
List-A
|
List-B
|
P: Binary Search Tree
|
1: Stack
|
Q: 0/1 knapsack problem
|
2: Greedy
|
R: Huffman Coding
|
3: Dynamic programming
|
S: Depth-first Search
|
4: Divide and Conquer
|
Find the total cost of the second best minimum Spanning tree(MST) _____?
[ Note: A second best MST is a spanning tree, that has the second minimum weight sum of all the edges, from all the possible spanning trees of the graph G ]
X = pqsprutrts
Y = qrstupqrs
A={ 20,16,1,10,13, 15, 9, 12, 11}
[ Hint: Pass is counted only when at least one swap is performed in the bubble sort pass ]
Find (5x+4y)%(x+y) = ______?
Find the total cost of the Minimum Spanning Tree(MST) using kruskal’s algorithm is___?

P)
45
|
35
|
25
|
26
|
30
|
23
|
20
|
21
|
22
|
25
|
26
|
15
|
14
|
10
|
9
|
Q)
75
|
55
|
45
|
46
|
43
|
30
|
29
|
30
|
25
|
32
|
35
|
20
|
19
|
18
|
17
|
R)
75
|
55
|
45
|
46
|
43
|
30
|
29
|
30
|
25
|
32
|
35
|
31
|
19
|
18
|
17
|
S)
45
|
35
|
25
|
26
|
30
|
23
|
20
|
21
|
22
|
25
|
26
|
15
|
14
|
22
|
9
|
The number of edges which are not included in any of the shortest paths from node ‘0’ is ______?
[ Hint: For example, in the matrix multiplication chain PQRSTU using parenthesization (P(QR))(S(TU)), QR and TU are only explicitly computed pairs ]
int Bob(n)
{
if (n == 1)
Alice();
else
John() + Bob(n-1);
}
What is the time complexity for the given function, if the function ‘Alice’ and ‘John’ take O(1) and O(logn) units of time respectively.
A
|
B
|
C
|
D
| |
Weight
|
1
|
3
|
4
|
5
|
Profit
|
1
|
4
|
5
|
7
|
Find the maximum profit obtained by placing objects into the knapsack using 0/1 Knapsack algorithm?
Find the minimum cost of tour by visiting all the cities available in the graph from the city 1.
PPP QQQQ P Q RRR SSSS RRRRR QQQ SS RRR
If Huffman tree code has left child with ‘1’ and right child with ‘0’ from every node then what is the decoded message for 1001010001.

Objects
|
P
|
Q
|
R
|
S
|
T
|
V
|
W
|
X
|
Weights
|
18
|
12
|
16
|
14
|
16
|
20
|
10
|
15
|
Profits
|
36
|
18
|
22
|
16
|
20
|
32
|
18
|
26
|
I. Consider an array containing ‘n’ elements which are in increasing order. The efficient time complexity to search one element which is not present in an array will take O(logn)
II. Counting sort uses Radix sort as a subroutine
III. Overlapping subproblems and Optimal Substructure properties are required to solve dynamic programming