Computer Science & Information Technology (CS) 2017 [Session 2]
Review the key details, then start the test when you are ready. You can also open the full package to see related papers.
Paper pattern & analysis
Available question types, difficulty and classifications for this paper.
Topic distribution
Subtopic distribution
Difficulty distribution
Question type distribution
Practise paper questions
Choose your answer to check it. Log in to view the explanation. For a timed attempt and result, start the exam.
I. \(L_1 \cup L_2\) is context-free.
II. \(\overline{L_1}\) is context-free.
III. \(L_1 - R\) is context-free.
IV. \(L_1 \cap L_2\) is context-free.
I. Canonical LR is more powerful than SLR.
II. SLR is more powerful than LALR.
III. SLR is more powerful than Canonical LR.
I. Program counter
II. Stack
III. Address space
IV. Registers
I. Contiguous
II. Linked
III. Indexed
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. Next pointer of front node points to the rear node.
II. Next pointer of rear node points to the front node.
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

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?
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.
In table T1, P is the primary key and Q is the foreign key referencing R in table T2 with on-delete cascade and on-update cascade. In table T2, R is the primary key and S is the foreign key referencing P in table T1 with 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 ________.


| Process | Current Allocation | Maximum Requirement |
|---|---|---|
| P1 | 3 | 7 |
| P2 | 1 | 6 |
| P3 | 3 | 5 |
Which of the following best describes current state of the system?

00000, 01011, 10101, 11110
Let the minimum Hamming distance of the code be \( p \) and the maximum number of erroneous bits that can be corrected by the code be \( q \). Then the values of \( p \) and \( q \) are
while (r >= y) { 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) \)?
int fun(int n) { int i, j; for (i = 1; i
Time complexity of fun in terms of \( \Theta \) notation is
| \( \delta \) | \( \epsilon \) | \( a \) | \( b \) |
|---|---|---|---|
| \( \rightarrow q_0 \) | \( \{q_2\} \) | \( \{q_1\} \) | \( \{q_0\} \) |
| \( q_1 \) | \( \{q_2\} \) | \( \{q_2\} \) | \( \{q_3\} \) |
| \( q_2 \) | \( \{q_0\} \) | \( \emptyset \) | \( \emptyset \) |
| \( q_3 \) | \( \emptyset \) | \( \emptyset \) | \( \{q_2\} \) |
Then \( \hat{\delta}(q_2, aba) \) is
\( L_1 = \{a^p \mid p \text{ is a prime number}\} \)
\( L_2 = \{a^n b^m c^{2m} \mid n \geq 0, m \geq 0\} \)
\( L_3 = \{a^n b^n c^{2n} \mid n \geq 0\} \)
\( L_4 = \{a^n b^n \mid n \geq 1\} \)
Which of the following are CORRECT?
I. \( L_1 \) is context-free but not regular.
II. \( L_2 \) is not context-free.
III. \( L_3 \) is not context-free but recursive.
IV. \( L_4 \) is deterministic context-free.
I. Given a regular expression \( R \) and a string \( w \), is \( w \in L(R) \)?
II. Given a context-free grammar \( G \), is \( L(G) = \emptyset \)?
III. Given a context-free grammar \( G \), is \( L(G) = \Sigma^* \) for some alphabet \( \Sigma \)?
IV. Given a Turing machine \( M \) and a string \( w \), is \( w \in L(M) \)?
| \( Q_1 \) | \( Q_0 \) | \( Q_1^+ \) | \( Q_0^+ \) |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 |
The counter is built as a synchronous sequential circuit using T flip-flops. The expressions for \( T_1 \) and \( T_0 \) are
int main() {
int array[] = {3, 5, 1, 4, 6, 2};
int done = 0;
int i;
while (done == 0) {
done = 1;
for (i=0; i if (array[i] < array[i+1]) {
swap(&array[i], &array[i+1]);
done = 0;
}
}
for (i=5; i>=1; i--) {
if (array[i] > array[i-1]) {
swap(&array[i], &array[i-1]);
done = 0;
}
}
}
printf("%d",array[3]);
}
The output of the program is __________.
\(T_1: r_1(X)w_1(X)r_1(Y)w_1(Y)\)
\(T_2: r_2(Y)w_2(Y)r_2(Z)w_2(Z)\)
where \(r_i(V)\) denotes a read operation by transaction \(T_i\) on a variable \(V\) and \(w_i(V)\) denotes a write operation by transaction \(T_i\) on a variable \(V\). The total number of conflict serializable schedules that can be formed by \(T_1\) and \(T_2\) is __________.
| Cache | Read access time (in nanoseconds) | Hit ratio |
|---|---|---|
| I-cache | 2 | 0.8 |
| D-cache | 2 | 0.9 |
| L2-cache | 8 | 0.9 |
The read access time of main memory is 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the write back policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% of memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is __________.
top_scorer
| player | country | goals |
|---|---|---|
| Klose | Germany | 16 |
| Ronaldo | Brazil | 15 |
| G Müller | Germany | 14 |
| Fontaine | France | 13 |
| Pelé | Brazil | 12 |
| Klinsmann | Germany | 11 |
| Kocsis | Hungary | 11 |
| Batistuta | Argentina | 10 |
| Cubillas | Peru | 10 |
| Lato | Poland | 10 |
| Lineker | England | 10 |
| T Müller | Germany | 10 |
| Rahn | Germany | 10 |
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta
WHERE ta.goals >ALL (SELECT tb.goals
FROM top_scorer AS tb
WHERE tb.country = 'Spain')
AND ta.goals >ANY (SELECT tc.goals
FROM top_scorer AS tc
WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is __________.
| Character | Probability |
|---|---|
| P | 0.22 |
| Q | 0.34 |
| R | 0.17 |
| S | 0.19 |
| T | 0.08 |
| Total | 1.00 |
If a message of 100 characters over \(X\) is encoded using Huffman coding, then the expected length of the encoded message in bits is __________.
Consider the set of processes with arrival time (in milliseconds), CPU burst time (in milliseconds), and priority (0 is the highest priority) shown below. None of the processes have I/O burst time.
| Process | Arrival Time | Burst Time | Priority |
|---|---|---|---|
| P1 | 0 | 11 | 2 |
| P2 | 5 | 28 | 0 |
| P3 | 12 | 2 | 3 |
| P4 | 2 | 10 | 1 |
| P5 | 9 | 16 | 4 |
The average waiting time (in milliseconds) of all the processes using preemptive priority scheduling algorithm is __________.
#include int main() { int m = 10; int n, n1; n = ++m; n1 = m++; n--; --n1; n -= n1; printf("%d", n); return 0; }
The output of the program is __________.
#include #include int main() { char* c = "GATECSIT2017"; char* p = c; printf("%d", (int)strlen(c+2[p]-6[p]-1)); return 0; }
The output of the program is __________.
There are 3 red socks, 4 green socks and 3 blue socks. You choose 2 socks. The probability that they are of the same colour is
The author’s belief that ideology is not as important as literature is revealed by the word:
There are three boxes. One contains apples, another contains oranges and the last one contains both apples and oranges. All three are known to be incorrectly labelled. If you are permitted to open just one box and then pull out and inspect only one fruit, which box would you open to determine the contents of all three boxes?
X is a 30 digit number starting with the digit 4 followed by the digit 7. Then the number X3 will have
An air pressure contour line joins locations in a region having the same atmospheric pressure. The following is an air pressure contour plot of a geographical region. Contour lines are shown at 0.05 bar intervals in this plot.

Showing 5 of 65 questions