## GATE Prev Year : Programming and Data Structures Test-2

- By Admin
- January 14, 2017
- No Comments

Question 1

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?

Question 2

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

Question 3

Suppose T(n) = 2T (n/2) + n, T(0) = T(1) = 1

Which one of the following is FALSE?

Question 4

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?

Question 5

In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is

Question 6

What does the following C-statement declare?

int (* f) (int *);

## Leave a Reply