GATE 2002 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2002

56 questions

MCQ 561-mark 56

Questions 31–35 of 56

Q31Function1 markMCQ−0.33 if wrong
The results returned by function under value-result and reference parameter passing conventions

Q32Array1 markMCQ−0.33 if wrong
Consider the following algorithm for searching for a given number x in an unsorted array A[1.....n] having n distinct values :

(1) Choose an i uniformly at random from [1....n]
(2) If A[i] = x then stop else Goto 1;

Assuming that x is present A, What is the expected number of comparisons made by the algorithm before it terminates?

Q33Array1 markMCQ−0.33 if wrong
Consider the following declaration of a two-dimensional array in C :

Char a[100][100]
Assuming that the main memory is byte-addressable and that array is stored starting from memory address 0, the address of a [40] [50] is

Q34Stack1 markMCQ−0.33 if wrong
To evaluate an expression without any embedded function calls