VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/gate-cs-1996/

⇱ Quiz about GATE CS 1996


Last Updated :
Discuss
Comments

Question 1

The process state transition diagram in below figure is representative of πŸ‘ Untitled
               

  • a batch operating system
  • an operating system with a preemptive schedular
  • an operating system with a non-preemptive schedular
  • a uni-programmed operating system

Question 2

Quicksort is run on two inputs shown below to sort in ascending order taking the first element as pivot,

(i) 1, 2, 3,......., n
(ii) n, n-1, n-2,......, 2, 1 

Let C1 and C2 be the number of comparisons made for the inputs (i) and (ii) respectively. Then,

  • C1 < C2 
     

  • C1 > C2

  • C1 = C2

  • We cannot say anything for arbitrary n

Question 3

Which of the following is false? πŸ‘ opt1
             

  • a
  • b
  • c
  • d

Question 4

A two dimensional array A[1...n][1...n] of integers is partially sorted if
βˆ€i, j ∈ [1...nβˆ’1], A[i][j] < A[i][j+1] and A[i][j] < A[i+1][j]
Fill in the blanks: a) The smallest item in the array is at A[i][j] where i=..................and j=...................... b) The smallest item is deleted. Complete the following O(n) procedure to insert item x (which is guaranteed to be smaller than any item in the last row or column) still keeping A partially sorted.
procedure insert (x: integer);
var i,j: integer;
begin
 i:=1; j:=1, A[i][j]:=x;
 while (x > ...... or x > ......) do
 if A[i+1][j] < A[i][j] ......... then begin
 A[i][j]:=A[i+1][j]; i:=i+1;
 end
 else begin
 ............
 end
 A[i][j]:= .............
end
.

Question 5

A complete, undirected, weighted graph G is given on the vertex {0, 1,...., nβˆ’1} for any fixed β€˜n’. Draw the minimum spanning tree of G if a) the weight of the edge (u,v) is ∣ uβˆ’v ∣ b) the weight of the edge (u,v) is u + v

Question 6

Consider the following program that attempts to locate an element x in a sorted array a[ ] using binary search. Assume N>1. The program is erroneous. Under what conditions does the program fail?


  • x is the last element of the array a[]

  • x is greater than all elements of the array a[]

  • Both of the Above

  • x is less than the last element of the array a[]

Question 7

Let G be the directed, weighted graph shown in below figure πŸ‘ gra
We are interested in the shortest paths from A. (a) Output the sequence of vertices identified by the Dijkstra’s algorithm for single source shortest path when the algorithm is started at node A. (b) Write down sequence of vertices in the shortest path from A to E. (c) What is the cost of the shortest path from A to E?

Question 8

A demand paged virtual memory system uses 16 bit virtual address, page size of 256 bytes, and has 1 Kbyte of main memory. LRU page replacement is implemented using a list whose current status (page number in decimal) is πŸ‘ pagetab
      . For each hexadecimal address in the address sequence given below
 00FF, 010D, 10FF, 11B0
indicate i) the new status of the list ii) page faults, if any, and iii) page replacements, if any

Question 9

A 1000 Kbyte memory is managed using variable partitions but no compaction. It currently has two partitions of sizes 200 Kbytes and 260 Kbytes respectively. The smallest allocation request in Kbytes that could be denied is for
  • 151
  • 181
  • 231
  • 541

Question 10

Consider the following program in pseudo-pascal syntax. What is printed by the program if parameter in procedure test1 is passed as i) call-by-reference parameter ii) call-by-value-result parameter
program Example (input, output)
var b: integer;
procedure test2:
begin b:=10; end
procedure test1 (a:integer):
begin 	a:=5;
 writeln ('point 1: ', a, b);
 test2;
 writeln ('point 2: ', a, b);
end
begin (*Example*)
b:=3; test1(b);
writeln('point3: ', b);
end
Tags:

There are 75 questions to complete.

Take a part in the ongoing discussion