• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE-CS-2005

Question 1

What does the following C-statement declare? [1 mark] C
int ( * f) (int * ) ;
  • A function that takes an integer pointer as argument and returns an integer.
  • A function that takes an integer as argument and returns an integer pointer.
  • A pointer to a function that takes an integer pointer as argument and returns an integer.
  • A function that takes an integer pointer as argument and returns a function pointer

Question 2

An Abstract Data Type (ADT) is:

  • Same as an abstract class

  • A data type that cannot be instantiated

  • A data type for which only the operations defined on it can be used, but none else

  • All of the above

Question 3

A common property of logic programming languages and functional languages is:

  • both are procedural languages

  • both are based on λ-calculus

  • both are declarative

  • both use Horn-clauses

Question 4

Which one of the following are essential features of an object-oriented programming language? (GATE CS 2005) (i) Abstraction and encapsulation (ii) Strictly-typedness (iii) Type-safe property coupled with sub-type rule (iv) Polymorphism in the presence of inheritance

  • (i) and (ii) only

  • (i) and (iv) only

  • (i), (ii) and (iv) only

  • (i), (iii) and (iv) only

Question 5

A program P reads in 500 integers in the range [0..100] representing the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies?

  • An array of 50 numbers

  • An array of 100 numbers

  • An array of 500 numbers

  • A dynamically allocated array of 550 numbers

Question 6

An undirected graph C has n nodes. Its adjacency matrix is given by an n × n square matrix whose (i) diagonal elements are 0\'s, and (ii) non-diagonal elements are l\'s. Which one of the following is TRUE?

  • Graph G has no minimum spanning tree (MST)

  • Graph G has a unique MST of cost n-1

  • Graph G has multiple distinct MSTs, each of cost n-1

  • Graph G has multiple spanning trees of different costs

Question 7

The time complexity of computing the transitive closure of a binary relation on a set of n elements is known to be

  • O (n)

  • O (n log n)

  • O(n3/2)

  • O(n3)

Question 8

Let A, B and C be non-empty sets and let X = (A - B) - C and Y = (A - C) - (B - C). Which one of the following is TRUE?

  • X = Y

  • X ⊂ Y

  • Y ⊂ X

  • none of these

Question 9

The following is the Hasse diagram of the poset [{a, b, c, d, e}, ≤] GATECS2005Q9 The poset is
  • not a lattice
  • a lattice but not a distributive lattice
  • a distributive lattice but not a Boolean algebra
  • a Boolean algebra

Question 10

Let G be a simple connected planar graph with 13 vertices and 19 edges. Then, the number of faces in the planar embedding of the graph is

  • 6

  • 8

  • 9

  • 13

There are 90 questions to complete.

Last Updated :
Take a part in the ongoing discussion