1.
A program P reads in 500 integers in the range [0..100] exepresenting 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? (GATE CS 2005)
2.
Which of the following operations is not O(1) for an array of sorted data. You may assume that array elements are distinct.
3.
The minimum number of comparisons required to determine if an integer appears more than n/2 times in a sorted array of n integers is
4.
Consider an array consisting of -ve and +ve numbers. What would be the worst case time complexity of an algorithm to segregate the numbers having same sign altogether i.e all +ve on one side and then all -ve on the other ?
5.
Let A[1...n] be an array of n distinct numbers. If i < j and A[i] > A[j], then the pair (i, j) is called an inversion of A. What is the expected number of inversions in any permutation on n elements?
6.
Which of the following points is/are true about Linked List data structure when it is compared with array
7.
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
8.
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is (GATE CS 2002)
9.
Suppose each set is represented as a linked list with elements in arbitrary order. Which of the operations among union, intersection, membership, cardinality will be the slowest? (GATE CS 2004)
10.
Which one of the following is an application of Stack Data Structure?