Exams › GATE › Technical › Computer Science and Information Technology (CS2)
22 questions with worked solutions.
Answer: X(i) = X(i − 1) + I(i); Y(i) = Y(i − 1)I(i); i > 0
The correct option accurately describes the relationship between the inputs and outputs, where the output X is the cumulative sum of the inputs, while Y is the product of the previous Y value and the current input, reflecting the operations performed at each iteration.
Answer: (n - 1) / 2
In a binary tree where every node has either zero or two children, the number of nodes with two children is always one less than the total number of leaf nodes. Since there are n nodes in total, the formula (n - 1) / 2 correctly represents the count of nodes with two children.
Answer: 0
Since L² = L⁻¹, we can deduce that L⁸ = (L²)⁴ = (L⁻¹)⁴ = (L⁴)⁻¹. Therefore, M = L⁸ = (L⁴)⁻¹ and N = L². This implies that M and N are inverses of each other, leading to M - N being singular, which results in a determinant of 0.
Answer: (P(0) ∧ (∀x [P(x) ⇒ P(x + 1)])) ⇒ (∀x P(x))
This statement is an application of mathematical induction, where proving that a property holds for the base case (P(0)) and that if it holds for an arbitrary case (P(x)), it also holds for the next case (P(x + 1)) ensures that the property is true for all natural numbers.
Answer: (i) is TRUE and (ii) is FALSE
Statement (i) is correct because ARP indeed maps IP addresses to hardware addresses, facilitating communication over a network. Statement (ii) is incorrect as TCP segments can carry both data and acknowledgements in the same segment, allowing for efficient communication.
Answer: Routing Information Protocol (RIP)
RIP is a routing protocol used for managing how routers communicate routing information, but it does not operate directly at the transport layer like the other options, which are protocols that handle data transmission and control.
Answer: Both (I) and (II) are correct.
Backpatching allows a compiler to handle jumps and branches in control flow and Boolean expressions efficiently by postponing the actual address resolution until all necessary information is available, enabling code generation in a single pass for both types of statements.
Q8. Which ONE of the following languages is accepted by a deterministic pushdown automaton?
Answer: Any regular language.
A deterministic pushdown automaton can recognize all regular languages because these languages can be represented by finite automata, which are a subset of the capabilities of deterministic pushdown automata.
Answer: Is L(G1) = ∅?
Determining whether the language generated by a context-free grammar is empty is decidable because there exists an algorithm that can analyze the grammar's production rules to check if any strings can be derived from it.
Answer: 19
The average turnaround time is calculated by finding the total time each process takes from arrival to completion and then averaging these times. In this case, the SRTF scheduling allows for efficient execution, resulting in a total turnaround time of 76 milliseconds for all processes, which when divided by 4 gives an average of 19 milliseconds.
Answer: Isolation
The violation of isolation occurs because the two simultaneous transactions were processed without recognizing that they were competing for the same account balance, leading to both transactions seeing the same initial balance and resulting in an incorrect final state.
Q12. Which of the following is/are part of an Instruction Set Architecture of a processor?
Answer: The total number of registers
The total number of registers is a fundamental aspect of the Instruction Set Architecture (ISA) because it defines how many data storage locations are available for instructions to use during execution, directly impacting the processor's performance and capabilities.
Answer: (i) – (b), (ii) – (a), and (iii) – (c)
The correct option matches context-free languages with not being closed under complementation, recursive languages with being closed under union, and regular languages with being closed under intersection, accurately reflecting the properties of these language classes.
Answer: 88.23
Transmission time Tt = 3000/2000 = 1.5 s and propagation Tp = 0.1 s. Stop-and-Wait utilization = Tt/(Tt+2Tp) = 1.5/(1.5+0.2) = 1.5/1.7 = 88.23%. Option 0.
Answer: 64 KB and 4 KB
The main memory size can be calculated using the total number of addressable locations, which is determined by the tag and index bits. With 4 bits for the tag and 12 bits for the index, the total addressable memory is 2^(4+12) = 64 KB. The cache size is determined by the number of cache blocks, which is 2¹² = 4096 blocks, and since each block is 1 byte, the cache size is 4 KB.
Answer: Θ(log n)
The correct option is Θ(log n) because a bitonic array can be efficiently searched using a modified binary search approach. This method allows us to find the peak element in logarithmic time, and then we can perform binary searches on the two sorted halves, resulting in an overall search time of Θ(log n).
Answer: (F, ≼) is a lattice
(F, ≼) is a lattice because it satisfies the properties of a partially ordered set where every pair of elements has both a least upper bound (join) and a greatest lower bound (meet), which can be defined in terms of the pointwise maximum and minimum of the functions.
Answer: x̅z̅ + xz
The expression x̅z̅ + xz simplifies to cover the cases where z is either 0 or 1, regardless of the value of x, which matches the output of the K-map. This indicates that the function F is true for both conditions of x when z is fixed, making it the correct representation.
Answer: Keep with every record in the stack, a pointer to the record with the smallest key below it.
This approach allows each record to directly reference the smallest key below it, enabling O(1) access to the minimum key without altering the time complexity of standard stack operations like PUSH and POP.
Answer: (D) R2 is NOT in 3NF
R2 is not in 3NF because the functional dependency C → A violates the condition for 3NF, as C is not a superkey and A is not a prime attribute.
Answer: 2Y - Z = 0
The equation 2Y - Z = 0 is correct because when you calculate the values of Y and Z from their hexadecimal representations, you find that doubling Y results in the same value as Z, confirming the equality.
Answer: {w | w ∈ {a,b}*, #a(w) ≡ 2 (mod 7), and #b(w) ≡ 3 (mod 9)}
Option C defines a regular language because it specifies constraints on the counts of 'a' and 'b' using modular arithmetic, which can be represented by finite automata. Regular languages can handle such conditions, as they can track a finite number of states corresponding to the remainders of the counts.