CS and IT Gate 2017 Set-1 Questions with Answer

Ques 40 Gate 2017 Set-1


Let T be a binary search tree with 15 nodes. The minimum and maximum possible heights of T are:
Note: The height of a tree with a single node is 0.

A

4 and 15 respectively

B

3 and 14 respectively

C

4 and 14 respectively

D

3 and 15 respectively


(Binary Search Tree) is the correct answer.

Ques 41 Gate 2017 Set-1


In a database system, unique time stamps are assigned to each transaction using Lamport’s logical clock. Let TS(T1) and TS(T2) be the time stamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database assuming that a killed transaction is restarted with the same timestamp.

if TS(T2) <TS(T1) then
    T1 is killed
else
    T2 waits.
.
.
Assume any transactions that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?

A

The database system is both deadlock-free and starvation- free.

B

The database system is deadlock- free, but not starvation-free.

C

The database system is starvation-free but not deadlock- free.

D

The database system is neither deadlock- free nor starvation-free.


(a) is the correct answer.

Ques 42 Gate 2017 Set-1


Consider a database that has the relation schemas EMP (EmpId, EmpName, DepId), and DEPT(DeptName, DeptId). Note that the DepId can be permitted to be NULL in the relation EMP. Consider the following queries on the database expressed in tuple relational calculus.

I. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∀ v ∈ DEPT (t[DeptId] ≠ DeptId]))}
II. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] ≠ DeptId]))}
III. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] = DeptId]))}

A

I and II only

B

I and III only

C

II and III only

D

I, II, and III


(Relational Algebra) is the correct answer.

Ques 43 Gate 2017 Set-1


The following functional dependencies hold true for the relational schema R{V, W, X, Y, Z}:

V→W
VW→X
Y→VX
Y→Z

Which of the following is irreducible equivalent for this set of functional dependencies?

A

V→W
V→X
Y→V
Y→Z

B

V→W
W→X
Y→V
Y→Z

C

V→W
V→X
Y→V
Y→X
Y→Z

D

V→W
W→X
Y→V
Y→X
Y→Z


(Functional Dependency) is the correct answer.

Ques 44 Gate 2017 Set-1


Consider the following table

Algorithms Design Paradigms
(P) Kruskal (i) Divide and Conquer
(Q) Quicksort (ii) Greedy
(R) Floyed Warshall (iii) Dynamic Programming


Match the algorithm to design paradigms they are based on:

A

P-(ii), Q-(iii), R-(i)

B

P-(iii), Q-(i), R-(ii)

C

P-(ii), Q-(i), R-(iii)

D

P-(i), Q-(ii), R-(iii)


(Algorithms) is the correct answer.

Ques 45 Gate 2017 Set-1


Consider the following functions from positives integers to real numbers

10, √n, n, log2n, 100/n.

The CORRECT arrangement of the above functions in increasing order of asymptotic complexity is:

A

log2n, 100/n,10, √n, n,

B

100/n,10,log2n, √n, n,

C

10,100/n, √n,log2n,n

D

100/n,log2n, 10,√n, n,


(Complexity) is the correct answer.

Ques 46 Gate 2017 Set-1


Consider the following intermediate program in three address code

p = a - b
q = p * c
p = u * v
q = p+q

Which one of the following corresponds to a static single assignment from the above code?

A

p1 = a - b
q1 =p1 * c
p1= u * v
q1 =p1 + q1

B

p3= a - b
q4= p3* c
p4= u * v
q5 =p4+ q4

C

p1 = a - b
q1=p2 * c
p3= u * v
q2= p4 + q3

D

p1 = a - b
q1= p * c
p2= u * v
q2= p + q


(Addressing Mode) is the correct answer.

Ques 47 Gate 2017 Set-1


When two 8-bit numbers A7 ... A0 and B7 ... B0 in 2^^s complement representation (with A0 and B0 as the least significant bits) are added using ripple-carry adder. the sum bits obtained are S7 ... S0 and the carry bits are C7 ... C0. An overflow is said to have occurred if

A

the carry bit C7 is 1

B

all the carry bits (C7, ... , C0 ) are 1

C

(A7 . B7 . S7' + A7' . B7' . S7) is 1

D

(A0 . B0 . S0' + A0' . B0' . S0) is 1


(Complements) is the correct answer.

Ques 48 Gate 2017 Set-1


Let p, q, and r be the propositions and the expression (p -> q) -> r be a contradiction. Then, the expression (r -> p)-> q is

A

a tautology

B

a contradiction

C

always TRUE when p is FALSE

D

always TRUE when q is TRUE


(d) is the correct answer.

Ques 49 Gate 2017 Set-1


Consider the first-order logic sentence

F: ∀ x (∃ y R(x,y)).

Assuming non-empty logical domains, which of the sentences below are implied by F?

I. ∃y (∃x R(x,y))
II. ∃y (∀x R(x,y))
III. ∀y (∃x R(x,y))
IV. ∼∃x (∀y R(x,y))

A

II only

B

IV only

C

I and IV only

D

II and III only


(Pridicate Calculus) is the correct answer.

Ques 50 Gate 2017 Set-1


The statement (¬ p) → (¬ q) is logically equivalent to which of the statements below?


I. p → q
II. q → p
III. (¬ q) ∨ p
IV. (¬ p) ∨ q

A

I only

B

II only

C

I and IV only

D

II and III only


(d) is the correct answer.

Ques 51 Gate 2017 Set-1


The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is ______.


(271) is the correct answer.

Ques 52 Gate 2017 Set-1


Let u and v be two vectors in R2 whose Euclidean norms satisfy ||u|| = 2||v||. What is the value α such that w = u + αv bisects the angle between u and v ?

A

2

B

1

C

1/2

D

-1/2


(a) is the correct answer.

Unique Visitor Count

Total Unique Visitors

Loading......