GATE 2017 (Session 2)
65 questions
MCQ 45 · NAT 201-mark 30 · 2-mark 35
Questions 16–20 of 65
Which of the following statements about 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.
I. Canonical LR is more powerful than SLR.
II. SLR is more powerful than LALR
III. SLR is more powerful than Canonical LR.
Answer: (A)
Order of power among LR parsers: LR(0) SLR LALR Canonical LR. This means only the statement "Canonical LR is more powerful than SLR" is correct.
Answer: I only
Answer: I only
Which of the following is/are shared by all the threads in a process ?
I. Program counter
II. Stack
III. Address space
IV. Registers
I. Program counter
II. Stack
III. Address space
IV. Registers
Answer: (B)
Every thread keeps its own program counter, its own stack and its own registers. The address space is what all threads of one process share. This covers code, data, heap and open files.
Answer: III only
Answer: III only
In a file allocation system, which of the following allocation schemes(s) can be used if no external fragmentation is allowed?
I. Contiguous
II. Linked
III. Indexed
I. Contiguous
II. Linked
III. Indexed
Answer: (D)
Contiguous allocation needs one large block of free space in one piece, so it leads to external fragmentation. Linked and indexed allocation can take free blocks from any place on the disk, so they do not have external fragmentation.
Answer: II and III only
Answer: II and III only
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 statements above are CORRECT?
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 statements above are CORRECT?
Answer: (C)
Let us check each statement:
- RIP uses distance vector. This is True. It runs over UDP (port 520). This is True.
- OSPF uses link state. This is True. It runs straight over IP (protocol 89), not TCP. This is False.
Answer: I, II and IV only
- RIP uses distance vector. This is True. It runs over UDP (port 520). This is True.
- OSPF uses link state. This is True. It runs straight over IP (protocol 89), not TCP. This is False.
Answer: I, II and IV only
If and , then the constants R and S are, respectively
Answer: (C)
Work through each condition:
- Differentiate: . Putting in the given value,
- Integrate f over 0 to 1: . The question says this is , so S = 0.
Answer: and 0
- Differentiate: . Putting in the given value,
- Integrate f over 0 to 1: . The question says this is , so S = 0.
Answer: and 0