CS and IT Gate 2021 SET-2 Questions with Answer

Ques 14 GATE 2021 SET-2


What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?

A

Θ(√n)

B

Θ(log2(n))

C

Θ(n2)

D

Θ(n)


(b) is the correct answer.

Ques 15 GATE 2021 SET-2


Consider a complete binary tree with 7 nodes. Let A denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let B denote the set of first 3 elements obtained by performing Depth-First Search (DFS) starting from the root. The value of |A - B| is _______.


(1 to 1) is the correct answer.

Ques 16 GATE 2021 SET-2


Consider the string abbccddeee. Each letter in the string must be assigned a binary code satisfying the following properties: 1. For any two letters, the code assigned to one letter must not be a prefix of the code assigned to the other letter. 2. For any two letters of the same frequency, the letter which occurs earlier in the dictionary order is assigned a code whose length is at most the length of the code assigned to the other letter. Among the set of all binary code assignments which satisfy the above two properties, what is the minimum length of the encoded string?

A

21

B

23

C

25

D

30


(b) is the correct answer.

Ques 17 GATE 2021 SET-2


Consider the following directed graph:

Which of the following is/are correct about the graph?

A

The graph does not have a topological order.

B

A depth-first traversal starting at vertex S classifies three directed edges as back edges.

C

The graph does not have a strongly connected component.

D

For each pair of vertices u and v, there is a directed path from u to v.


(a; b) is the correct answer.

Ques 18 GATE 2021 SET-2


In a directed acyclic graph with a source vertex s, the quality-score of a directed path is defined to be the product of the weights of the edges on the path. Further, for a vertex v other than s, the quality-score of v is defined to be the maximum among the quality-scores of all the paths from s to v. The quality-score of s is assumed to be 1.

The sum of the quality-scores of all the vertices in the graph shown above is _______.


(929 to 929) is the correct answer.

Ques 19 GATE 2021 SET-2


Consider the following statements S1 and S2 about the relational data model:
S1: A relation scheme can have at most one foreign key.
S2: A foreign key in a relation scheme R cannot be used to refer to tuples of R.
Which one of the following choices is correct?

A

Both S1 and S2 are true.

B

S1 is true and S2 is false.

C

S1 is false and S2 is true.

D

Both S1 and S2 are false.


(d) is the correct answer.

Ques 20 GATE 2021 SET-2


A data file consisting of 1,50,000 student-records is stored on a hard disk with block size of 4096 bytes. The data file is sorted on the primary key RollNo. The size of a record pointer for this disk is 7 bytes. Each student-record has a candidate key attribute called ANum of size 12 bytes. Suppose an index file with records consisting of two fields, ANum value and the record pointer to the corresponding student record, is built and stored on the same disk. Assume that the records of data file and index file are not split across disk blocks. The number of blocks in the index file is _______.


(698 to 698) is the correct answer.

Ques 21 GATE 2021 SET-2


Suppose the following functional dependencies hold on a relation U with attributes P, Q, R, S, and T:
P → QR
RS → T
Which of the following functional dependencies can be inferred from the above functional dependencies?

A

PS → T

B

R → T

C

P → R

D

PS → Q


(a; c; d) is the correct answer.

Ques 22 GATE 2021 SET-2


Which one of the following circuits implements the Boolean function given below?
f(x,y,z) = m0 + m1 + m3 + m4 + m5 + m6, where mi is the ith minterm.

A

B

C

D


(a) is the correct answer.

Ques 23 GATE 2021 SET-2


If x and y are two decimal digits and (0.1101)2 = (0.8xy5)10, the decimal value of x + y is _______.


(3 to 3) is the correct answer.

Ques 24 GATE 2021 SET-2


Consider a Boolean function f(w,x,y,z) such that
f(w,0,0,z) = 1
f(1,x,1,z) = x + z
f(w,1,y,z) = wz + y
The number of literals in the minimal sum-of-products expression of f is _______.


(6 to 6) is the correct answer.

Ques 25 GATE 2021 SET-2


Gauri said that she can play the keyboard _______ her sister.

A

as well as

B

as better as

C

as nicest as

D

as worse as


(a) is the correct answer.

Ques 26 GATE 2021 SET-2


Pen: Write:: Knife: _______
Which one of the following options maintains a similar logical relation in the above?

A

Vegetables

B

Sharp

C

Cut

D

Blunt


(c) is the correct answer.

Unique Visitor Count

Total Unique Visitors

Loading......