GATE 2017 (Session 2)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 26–30 of 65
Identify the language generated by the following grammar, where S is start variable.
S XY
X aX|a
Y aYb|
S XY
X aX|a
Y aYb|
Answer: (C)
X produces where k 1. Y produces where n 0. When we join them, the string is , so the number of a's is strictly greater than the number of b's.
Answer:
Answer:
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?
Answer: (C)
Take R as many-to-one from A to B, with A participating totally. Then every A-tuple is linked to exactly one B-tuple. So the key of B can go into A's table as a column (a foreign key), with no NULLs and no repeated rows.
Answer: Relationship R is many-to-one and the participation of A in R is total
Answer: Relationship R is many-to-one and the participation of A in R is total
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.
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.
Answer: (B)
Let us check each statement:
- I: A connected UDP socket is fixed to one peer. It ignores datagrams that come from any other peer. So this is False.
- II: A process may call connect again on a UDP socket, either to change the peer or to disconnect. So this is True.
Answer: II only
- I: A connected UDP socket is fixed to one peer. It ignores datagrams that come from any other peer. So this is False.
- II: A process may call connect again on a UDP socket, either to change the peer or to disconnect. So this is True.
Answer: II only
Consider the following tables T1 and T2.
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with ondelete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 on-delete set NULL and on-update cascade. In order to delete record (3,8) from table T1, the number of additional records that need to be deleted from table T1 is _____.
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with ondelete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 on-delete set NULL and on-update cascade. In order to delete record (3,8) from table T1, the number of additional records that need to be deleted from table T1 is _____.
Answer: 0
We delete the record (3, 8) from T1. In T2, S is a foreign key on T1.P with ON DELETE SET NULL. So the T2 row (8, 3) only has its S changed to NULL. No row of T2 is deleted, so nothing cascades back to T1.
Answer: 0
Answer: 0
The maximum number of IPv4 router addresses that can be listed in the record route (RR) option field of an IPv4 header is _________.
Answer: 9
The options part of an IPv4 header can be 40 bytes at most. The Record Route option takes 3 bytes for type, length and pointer. The other 37 bytes store addresses, and each address is 4 bytes long: .
Answer: 9
Answer: 9