# GATE Computer Science Solved Paper 2017 Session II - Part 2

11.       Let p, q, r denote the statements “It is raining”, “It is cold”, and “It is pleasant”, respectively. Then the statement “It is not raining and it is pleasant, and it is not pleasant only if it is raining and it is cold” is represented by
(A) (¬p á´§ r) á´§ (¬r→(p á´§ q))
(B) (¬p á´§ r) á´§ ((p á´§ q)→¬r)
(C) (¬p á´§ r) á´  ((p á´§ q)→¬r)
(D) (¬p á´§ r) v (r→(p á´§ q))
12.       Given the following binary number in 32-bit (single precision) IEEE-754 format:

00111110011011010000000000000000

The decimal value closest to this floating-point number is
(A) 1.45 x 101
(B) 1.45 x 10-1
(C) 2.27 x 10-1
(D) 2.27 x 101
13.       A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively. Which of the following statements is/are CORRECT for such a circular queue, so that insertion and deletion operations can be performed in O(1) time?
I. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.
(A) I only
(B) II only
(C) Both I and II
(D) Neither I nor II
14.       Consider the following function implemented in C:
void printxy(int x, int y) {
int *ptr;
x = 0;
ptr = &x;
y = *ptr;
*ptr = 1;
printf(“%d,%d”,x,y);
}
The output of invoking printxy (1, 1) is
(A) 0, 0
(B) 0, 1
(C) 1, 0
(D) 1, 1
15.       The Breadth First Search (BFS) algorithm has been implemented using the queue data structure. Which one of the following is a possible order of visiting the nodes in the graph below?
(A) MNOPQR
(B) NQMPOR
(C) QMNROP
(D) POQNMR

16.       Identify the language generated by the following grammar, where S is the stall variable.
S → XY
X → aX | a
Y → aYb | Îµ
(A) {ambn | m ≥ n, n > 0}
(B) {ambn | m ≥ n, n ≥ 0}
(C) {ambn | m > n, n ≥ 0}
(D) {ambn | m > n, n > 0}
17.       An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A?
(A) Relationship R is one-to-many and the participation of A in R is total.
(B) Relationship R is one-to-many and the participation of A in R is partial.
(C) Relationship R is many-to-one and the participation of A in R is total.
(D) Relationship R is many-to-one and the participation of A in R is partial.
18.       Consider socket API on a Linux machine that supports connected UDP sockets. 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.
(A) I only
(B) II only
(C) Both I and II
(D) Neither I nor II