Question 1
The following C declarations
struct node
{
int i;
float j;
};
struct node *s[10] ;
define s to be
An array, each element of which is a pointer to a structure of type node
A structure of 2 fields, each field being a pointer to an array of 10 elements
A structure of 3 fields: an integer, a float, and an array of 10 elements
An array, each element of which is a structure of type node.
Question 2
Which of the following need not necessarily be saved on a context switch between processes?
General purpose registers
Translation look aside buffer
Program counter
All of the above
Question 3
Suppose the time to service a page fault is on the average 10 milliseconds, while a memory access takes 1 microsecond. Then a 99.99% hit ratio results in average memory access time of
1.9999 milliseconds
1 millisecond
9.999 microseconds
1.9999 microseconds
Question 4
The value of j at the end of the execution of the following C program.
int incr(int i)
{
static int count = 0;
count = count + i;
return (count);
}
main()
{
int i,j;
for (i = 0; i <=4; i++)
j = incr(i);
}
10
4
6
7
Question 5
A graphics card has on board memory of 1 MB. Which of the following modes can the card not support?
1600 x 400 resolution with 256 colours on a 17-inch monitor
1600 x 400 resolution with 16 million colours on a 14-inch monitor
800 x 400 resolution with 16 million colours on a 17-inch monitor
800 x 800 resolution with 256 colours on a 14-inch monitor
Question 6
An n x n array v is defined as follows:
v[i, j] = i-j for all i, j, 1 <= i <= n, 1 <= j <= nThe sum of the elements of the array v is
0
n-1
n2 - 3n + 2
n2 (n+1)/2
Question 7
X, Y and Z are closed intervals of unit length on the real line. The overlap of X and Y is half a unit. The overlap of Y and Z is also half a unit. Let the overlap of X and Z be k units. Which of the following is true?
k must be 1
k must be 0
k can take any value between 0 and 1 (d) None of the above
None of the above
Question 8
Suppose you are given an array s[1..n] and a procedure reverse (s, i, j) which reverses the order of elements in a between positions i and j (both inclusive). What does the following sequence do, where 1 <= k <= n:
reverse(s, 1, k) ;
reverse(s, k + 1, n);
reverse(s, l, n);
Rotates s left by k positions
Leaves s unchanged
Reverses all elements of s
None of the above
Question 9
Let G be an undirected graph. Consider a depth-first traversal of G, and let T be the resulting depth-first search tree. Let u be a vertex in G and let v be the first new (unvisited) vertex visited after visiting u in the traversal. Which of the following statements is always true?
{u,v} must be an edge in G, and u is a descendant of v in T
{u,v} must be an edge in G, and v is a descendant of u in T
If {u,v} is not an edge in G then u is a leaf in T
If {u,v} is not an edge in G then u and v must have the same parent in T
Question 10
Given the following relation instance.
x y z
1 4 2
1 5 3
1 6 3
3 2 2
Which of the following functional dependencies are satisfied by the instance? (GATE CS 2000)
XY -> Z and Z -> Y
YZ -> X and Y -> Z
YZ -> X and X -> Z
XZ -> Y and Y -> X
There are 49 questions to complete.