GATE-CS-2000 (original) (raw)
The following C declarations
C `
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.
Which of the following need not necessarily be saved on a context switch between processes?
- General purpose registers
- Translation look aside buffer
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
The value of j at the end of the execution of the following C program.
C `
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); }
`
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
An n x n array v is defined as follows:
v[i, j] = i-j for all i, j, 1 <= i <= n, 1 <= j <= n
The sum of the elements of the array v is
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 can take any value between 0 and 1 (d) None of the above
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
- Reverses all elements of s
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
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)
There are 49 questions to complete.
Take a part in the ongoing discussion