CS/IT Gate Yearwise
CS/IT Gate 2025 (Set 2)
CS/IT Gate 2024 (Set 1)
CS/IT Gate 2024 (Set 2)
CS/IT Gate 2023
CS/IT Gate 2022
CS/IT Gate 2021 (Set 1)
CS/IT Gate 2021 (Set 2)
CS/IT Gate 2020
CS/IT Gate 2019
CS/IT Gate 2018
CS/IT Gate 2017 (Set 1)
CS/IT Gate 2017 (Set 2)
CS/IT Gate 2016 (Set 1)
CS/IT Gate 2016 (Set 2)
CS/IT Gate 2015 (Set 1)
CS/IT Gate 2015 (Set 2)
CS/IT Gate 2015 (Set 3)
CS/IT Gate 2014 (Set 1)
CS/IT Gate 2014 (Set 2)
CS/IT Gate 2014 (Set 3)
CS and IT GATE 2017 Set-2 Questions with Answer
Ques 14 Automata
Let L1 and L2 be any context-free language and R be any regular language. Then, which of the following is correct ?
II. L1' is context-free.
III. L1-R is context-free.
IV. L1 ∩ L2 context-free.
Ques 15 C Programming
Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variable x, y, q and r are all unsigned int.
{
r = r - y;
q = q + 1;
}
Which of the following conditions on the variables x, y, q and r before the execution of the fragment will ensure that the loop terminates in a state satisfying the condition x == (y*q + r)?
Ques 16 C Programming
Consider the following function implemented in C:
{
int *ptr;
x = 0;
ptr = &x;
y = *ptr;
*ptr = 1;
printf("%d,%d", x, y);
}
The output of the printxy(1,1) is
Ques 17 Compiler Design
Which of the following statements about the parser is/are correct?
I. Canonical LR is more powerful than SLR.
II. SLR is more powerful than LALR.
III. SLR is more powerful than canonical LR.
Ques 18 Compiler Design
Match the following according to input(from the left column) to the compiler phase(in the right column) that process it:
(P)Syntax Tree | (i)Code generator |
(Q)Character Stream | (ii)Syntax analyser |
(R)Intermediate representation | (iii)Semantic analyser |
(S)Token stream | (iv)Lexical analyser |
Ques 19 Computer Network
The maximum number of IPv4 router address addresses that can be listed in the record route (RR) option field of an IPv4 header is ____.
a is the correct answer.
Ques 20 Computer Network
Consider a socket API on Linux machine that supports UDP socket. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are correct ?
I. A connected UDP socket can be used to communicate with multiple peers simultaneously.
II. A process can successfully call connect function again for an already connected UDP socket.
Ques 21 Computer Network
Consider a socket API on Linux machine that supports UDP socket. A connected UDP socket is a UDP socket on which connect function has already been called. Which of the following statements is/are correct ?
I. A connected UDP socket can be used to communicate
with multiple peers simultaneously.
II. A process can successfully call connect function
again for an already connected UDP socket.
Ques 22 Computer Network
Consider the following statements about the routing protocols, Routing Information Protocol(RIP) and Open Shortest Path First(OSPF) in an IPv4 network.
I. RIP uses distance vector routing
II. RIP packets are sent using UDP
III. OSPF packets are sent using TCP
IV. OSPF operation is based on link-state routing
Which of the following above are CORRECT?
Ques 23 Data Structure
G is undirected graph with n vertices and 25 edges such that each vertex has degree at least 3. Then the maximum possible value of n is ________
a is the correct answer.
Ques 24 Data Structure
A Circular queue has been implemented using singly linked list where each node consists of a value and a pointer to next node. We maintain exactly two pointers FRONT and REAR pointing to the front node and rear node of queue. Which of the following statements is/are correct for circular queue so that insertion and deletion operations can be performed in O(1) i.e. constant time.
I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.
Ques 25 Data Structure
Match the following:
(P)static char var; | (i)Sequence of memory locations to store addresses |
(Q)m=malloc(10); m=NULL; |
(ii)A variable in data section of memory |
(R)char *ptr[10]; | (iii)Request to allocate a CPU register to store data |
(S)register int var1; | (iv)A lost memory which cannot be freed |
Ques 26 Data Structure
Match the algorithms with their time complexities:
Algorithm | Time Complexity |
---|---|
(P)Tower of Hanoi with n disks | (i)θ(n2) |
(Q)Binary Search given n sorted numbers | (ii)θ(nlogn) |
(R)Heap sort of n numbers at the worst case | (iii)θ(2n) |
(S)Addition of two n*n matrices | (iv)θ(logn) |

Total Unique Visitors