GATE CS 1999

Last Updated :
Discuss
Comments

Question 1

Given the programming constructs

i) assignment 

ii) for loops where the loop parameter cannot be changed within the loop 

iii) if-then-else 

iv) forward  go to

v) arbitrary go to 

vi) non-recursive procedure call

vii) recursive procedure/function call 

viii) repeat loop,

which constructs will you not include in a programming language such that it should be possible to program the terminates (i.e. halting) function in the same programming language.

  • ii), iii), iv)

  • v), vii), viii)

  • vi), vii), viii)

  • iii), v), viii)

Question 2

Which of the following actions is/are typically not performed by the operating system when switching context from process A to process B?
  • Saving current register values and restoring saved register values for process B.
  • Changing address translation tables.
  • Swapping out the memory image of process A to the disk.
  • Invalidating the translation look-aside buffer.

Question 3

Consider the following C function definition.
int Trial (int a, int b, int c)
{
    if ((a >= b) && (c < b) return b;
    else if (a>=b) return Trial(a, c, b);
    else return Trial(b, a, c);
}
The function Trial:
  • finds the maximum of a, b and c
  • finds the minimum of a, b and c
  • finds the middle number of a, b and c
  • None of the above

Question 4

If T1 = O(1), give the correct matching for the following pairs:
(M) Tn=Tn−1+n           (U) Tn=O(n)
(N) Tn=Tn/2 +n          (V) Tn=O(nlogn)
(O) Tn=Tn/2 +nlogn      (W) T=O(n^2)
(P) Tn=Tn−1 +logn       (X) Tn=O(log^2n) 
  • M-W N-V O-U P-X
  • M-W N-U O-X P-V
  • M-V N-W O-X P-U
  • M-W N-U O-V P-X

Question 5

The minimum number of record movements required to merge five files A (with 10 records), B (with 20 records), C (with 15 records), D (with 5 records) and E (with 25 records) is:
  • 165
  • 90
  • 75
  • 65

Question 6

A sorting technique is called stable if:

  • It takes O(n*log(n)) time

  • It maintains the relative order of occurrence of non-distinct elements

  • It uses divide and conquer paradigm

  • It takes O(n) space

Question 7

Suppose we want to arrange the ii numbers stored in an array such that all negative values occur before all positive ones. Minimum number of exchanges required in the worst case is:
  • n-1
  • n
  • n+1
  • None of the above

Question 8

If one uses a straight two-way merge sort algorithm to sort the following elements in ascending order 20, 47, 15, 8, 9, 4, 40, 30, 12, 17 then the order of these elements after the second pass of the algorithm is:

  • 8, 9, 15, 20, 47, 4, 12, 17, 30, 40

  • 8, 15, 20, 47, 4, 9, 30, 40, 12, 17

  • 15, 20, 47, 4, 8, 9, 12, 30, 40, 17

  • 4, 8, 9, 15, 20, 47, 12, 17, 30, 40

Question 9

Listed below are some operating system abstractions (in the left column) and the hardware components or mechanism (in the right column) that they are abstractions of. Which of the following matching of pairs is correct?
A. Thread                      1. Interrupt
B. Virtual address space       2. Memory
C. File system                 3. CPU
D. Signal                      4. Disk
  • A-2, B-4, C-3, D-1
  • A-1, B-2, C-3, D-4
  • A-3, B-2, C-4, D-1
  • A-4, B-1, C-2, D-3

Question 10

Which of the following is/are advantages of virtual memory? a) Faster access to memory on an average. b) Processes can be given protected address spaces. c) Linker can assign addresses independent of where the program will be loaded in physical memory. d) Programs larger than the physical memory size can be run.
  • a and b
  • b and c
  • b and d
  • All of the above
Tags:

There are 70 questions to complete.

Take a part in the ongoing discussion