Ada Ds Gate Ques
-
Upload
vrinda-kaushal -
Category
Documents
-
view
226 -
download
1
Transcript of Ada Ds Gate Ques
1 [ADA & DS]
ADA and ds GATE QUESTIONS 1991
1. The minimum number of comparisons required to sort 5 elements is _____
4 [ADA & DS]
1993 1. Summation of O(n) over 1<=k<=n where O(n) stands for order n is:
(a) O(n) (b) O(n square) (c) O(n cube) (d) O(3 *n square) (e) O(1.5 * n square)
1994
6 [ADA & DS]
1995 1. Merge sort uses
(a) Divide and conquer strategy (b) Backtracking approach
(c) Heuristic search (d) Greedy approach
4.Consider the following sequence of numbers 92, 37, 52, 12, 11, 25 Use bubblesort to arrange
the sequence in ascending order. Give the sequence at the end of each of the first five passes.
21 [ADA & DS]
2001
(a) Insert the following keys one by one into a binary search tree in the order specified. 15, 32,
20, 9, 3, 25, 12, 1 Show the final binary search tree after the insertions.
22 [ADA & DS]
2002
6. Draw all binary trees having exactly three nodes labeled A, B and C on which
Preorder traversal gives the sequence C,B,A.
24 [ADA & DS]
2003 4. Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs
of sequences, B and C are there such that (i) each is sorted in ascending order, (ii) B has 5 and C
has 3 elements, and (iii) the result of merging B and C gives A?
(A) 2 (B) 30 (C) 56 (D) 256
25 [ADA & DS]
19. Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty
binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the
in-order traversal sequence of the resultant tree?
(A) 7 5 1 0 3 2 4 6 8 9 (B) 0 2 4 3 1 6 5 9 8 7
(C) 0 1 2 3 4 5 6 7 8 9 (D) 9 8 6 4 2 3 0 1 5 7