• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE CS 1998

Question 21

Give the correct matching for the following pairs:
A. O(log n)     1. Selection sort
B. O(n)         2. Insertion sort
C. O(nlog n)    3. Binary search
D. O(n^2)       4. Merge sort

codes: 
     A   B   C   D
a.   3   1   2   4
b.   3   1   4   2
c.   1   3   4   2
d.   1   4   3   2

  • a
  • b
  • c
  • d

Question 22

How many substrings of different length (non-zero) can be formed from a character string of length n ?

  • n

  • n2

  • 2n

  • n(n+1)/2

Question 23

Which of the following statement is false?
  • A tree with n nodes has (n-1) edges.
  • A labeled rooted binary tree can be uniquely constructed given its postorder and preorder traversal results.
  • A complete binary tree with n internal nodes has (n+1) leaves.
  • The maximum number of nodes in a binary tree of height h is (2^(h+1) -1).

Question 24

In a resident- OS computer, which of the following system software must reside in the main memory under all situations?
  • Assembler
  • Linker
  • Loader
  • Compiler

Question 25

Which of the following statement is true?
  • SLR parser is more powerful than LALR.
  • LALR parser is more powerful than Canonical LR parser.
  • Canonical LR parser is more powerful than LALR parser.
  • The parsers SLR, Canonical LR, and LALR have the same power.

Question 26

Type checking is normally done during
  • Lexical analysis
  • Syntax analysis
  • Syntax directed translation
  • Code optimization

Question 27

A linker reads four modules whose lengths are 200, 800, 600 and 500 words respectively. If they are loaded in that order, what are the relocation constants?
  • 0, 200, 500, 600
  • 0, 200, 1000, 1600
  • 200, 500, 600, 800
  • 200, 700, 1300, 2100

Question 28

Which of the following is an example of a spooled device?
  • The terminal used to enter the input data for the C program being executed.
  • An output device used to print the output of a number of jobs.
  • The secondary memory device in a virtual storage system.
  • The swapping area on a disk used by the sapper.

Question 29

When the result of a computation depends on the speed of the processes involved, there is said to be
  • cycle stealing
  • race condition
  • a time lock
  • a deadlock

Question 30

A computer has six tape drives, with n processes competing for them. Each process may need two drives. What is the maximum value of n for the system to be deadlock free?
  • 6
  • 5
  • 4
  • 3

There are 83 questions to complete.

Last Updated :
Take a part in the ongoing discussion