CS and IT Gate 2021 Set-1 Questions with Answer

Ques 27 GATE 2021 SET-1


There are five bags each containing identical sets of ten distinct chocolates. One chocolate is picked from each bag. The probability that at least two chocolates are identical is __________ .

A

0.3024

B

0.4235

C

0.6976

D

0.8125


(c) is the correct answer.

Ques 28 GATE 2021 SET-1


Three processes arrive at time zero with CPU bursts of 16, 20 and 10 milliseconds. If the scheduler has prior knowledge about the length of the CPU bursts, the minimum achievable average waiting time for these three processes in a non-preemptive scheduler (rounded to nearest integer) is _________ milliseconds.


(12) is the correct answer.

Ques 29 GATE 2021 SET-1


In the context of operating systems, which of the following statements is/are correct with respect to paging?

A

Paging helps solve the issue of external fragmentation.

B

Page size has no impact on internal fragmentation.

C

Paging incurs memory overheads.

D

Multi-level paging is necessary to support pages of different sizes.


(a, c) is the correct answer.

Ques 30 GATE 2021 SET-1


Consider the following ANSI C program.

Which one of the following options is correct?

A

The program will not compile successfully.

B

The program will compile successfully and output 10 when executed.

C

The program will compile successfully and output 8 when executed.

D

The program will compile successfully and output 13 when executed.


(b) is the correct answer.

Ques 31 GATE 2021 SET-1


Consider the following statements.
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?

A

S1 is true and S2 is false.

B

S1 is false and S2 is true.

C

Both S1 and S2 are true.

D

Both S1 and S2 are false.


(c) is the correct answer.

Ques 32 GATE 2021 SET-1


A binary search tree T contains n distinct elements. What is the time complexity of picking an element in T that is smaller than the maximum element in T?

A

Θ(n log n)

B

Θ(n)

C

Θ(log n)

D

Θ(1)


(d) is the correct answer.

Ques 33 GATE 2021 SET-1


Consider the following array.

Which algorithm out of the following options uses the least number of comparisons (among the array elements) to sort the above array in ascending order?

A

Selection sort

B

Mergesort

C

Insertion sort

D

Quicksort using the last element as pivot


(c) is the correct answer.

Ques 34 GATE 2021 SET-1


A binary search tree T contains n distinct elements.
What is the time complexity of picking an element in T that is smaller than the maximum element in T?

A

Θ(n log n)

B

Θ(n)

C

Θ(log n)

D

Θ(1)


(d) is the correct answer.

Ques 35 GATE 2021 SET-1


Consider the following sequence of operations on an empty stack.
push(54); push(52); pop(); push(55); push(62); s = pop();
Consider the following sequence of operations on an empty queue.
enqueue(21); enqueue(24); dequeue(); enqueue(28); enqueue(32); q = dequeue();
The value of s + q is


(86) is the correct answer.

Ques 36 GATE 2021 SET-1


A polygon is convex if, for every pair of points, P and Q belonging to the polygon, the line segment PQ lies completely inside or on the polygon.
Which one of the following is NOT a convex polygon?

A

B

C

D


(a) is the correct answer.

Ques 37 GATE 2021 SET-1


A circular sheet of paper is folded along the lines in the directions shown.
The paper, after being punched in the final folded state as shown and unfolded in the reverse order of folding, will look like

A

B

C

D


(a) is the correct answer.

Ques 38 GATE 2021 SET-1


Details of prices of two items P and Q are presented in the above table.
The ratio of cost of item P to cost of item Q is 3:4.
Discount is calculated as the difference between the marked price and the selling price.
The profit percentage is calculated as the ratio of the difference between selling price and cost, to the cost
(Profit % =((Selling price − cost)/cost) × 100).
The discount on item Q, as a percentage of its marked price, is

A

25

B

12.5

C

10

D

5


(c) is the correct answer.

Ques 39 GATE 2021 SET-1


Consider the following grammar (that admits a series of declarations, followed by expressions) and the associated syntax directed translation (SDT) actions, given as pseudo-code:
P -> DE
D -> int ID {record that ID.lexeme is of type int}
D -> bool ID {record that ID.lexeme is of type bool}
E -> E1 + E2 {check that E1.type = E2.type = int; set E.type:= int}
E ->!E1 {check that E1.type = bool; set E.type:= bool}
E -> ID {set E.type:= int}
With respect to the above grammar, which one of the following choices is correct?

A

The actions can be used to correctly type-check any syntactically correct program.

B

The actions can be used to type-check syntactically correct integer variable declarations and integer expressions.

C

The actions can be used to type-check syntactically correct boolean variable declarations and boolean expressions.

D

The actions will lead to an infinite loop.


(b) is the correct answer.

Unique Visitor Count

Total Unique Visitors

Loading......