Saturday, September 27, 2008

DATA STRUCTURES

1. Comparisons required to insert a node after the last node in a circular linked list is
a. O(logn)
b. O(n)
c. O(1)
d. None of the above

2. The average case analysis of Linear search on the array of size n requires …….. comparison
a. n/2
b. n
c. (n-1)/2
d. (n+1)/2

3. The address of element P[6,12] in the row major order array P[-1:10, -2:20] where every element takes 2 bytes of storage with base address 2000 is ………..

4. Match the elements of table1 with table2.
Table 1 Table 2
-------------------------------------------------------
1. Linear search(worst case) a. O(nlogn)
2. Quick sort (worst case) b. O(n)
3. Binary Search (best case) c. O(n2)
4. Merge Sort (average case) d. O(1)

5. Minimum no of scalar multiplication required to multiply Matrices A1, A2, A3 of size 15x25, 25x100, 100x5 is …………………

6. We store a triangular sparse array of size nxn in a two dimensional array storing only the nonzero elements. The base address of such an array is 1000, what will be the address of element A[100,50]? (consider every element occupies 1 word of m/y).

7. Pick the odd one out

a. Adjacency matrix of the tree graph
b. Identity matrix
c. Tridiagonal matrix
d. Adjacency matrix of the complete graph

8. Minimum no of pointer adjustment for deletion of last node from doubly linked list is
a. 1
b. 2
c. 3
d. 4
9. For conversion of infix expression given below to postfix, no of PUSH and POP operation performed is…………………..
a * b + c / d ↑ e ↑ f

10. PUSH and POP operations for evaluation of postfix expression 4 3 2 ↑ * 6 – 8+ is
a. 9 PUSH, 8 POP
b. 5 PUSH, 4 POP
c. 5 PUSH, 9 POP
d. 9 PUSH, 9 POP

11. Best suited data structure to find the validity of mathematical expression with all types of brackets e.g. [ ], { }, ( ) is ……………

12. Wich among the following sorting technique is stable
a. Bubble
b. Selection
c. Counting
d. Merge

13. The expression a ↑ b ↑ c * d *e / f / g / h in polish notation is ……………………

14. Which among the following algorithm requires application of stacks (directly or indirectly)
a. Quick sort
b. Heap sort
c. Selection sort
d. Bubble sort

15. Arrange the following algorithm in increasing order in terms of worst case run time
a. Sequential search
b. Bubble sort
c. Binary search
d. Heap sort
16. The stack can be used to find if the given string is palindrome or not. No of POP operations required to do the same on the string MISSISSIM is ……………….

17. Evaluated value of expression - + * 4 2 9 / 6 2 is …………..

18. Circular queue has advantage over linear queue. Reason for the same is ……………………………………

19. consider the double ended queue given below
Right Left
A B C D E F
The overflow occurs when
a. Left = Right
b. Left + 1 = Right
c. Left = right +1
d. None

20. Applying the quick sort algorithm on set <100, 50, 20 , 120 , 70, 30, 150, 10, 40>, no of elements in left and right half after the first pass is:

21. Which among the following is not an application of data structure
a. Symbol table
b. Storage & retrieval of large volume of data
c. Sorting
d. Machine learning

22. Which among the following algorithms does not require the sorted set as pre-requisite
a. Merge
b. Sequential search
c. Binary search
d. Index-Sequential search

23. Pick the odd one out
a. Data type
b. Data object
c. Abstract data type
d. Data line

24. Which triplet defines the abstract data type

25. Arranging the set of strings alphabetically is called ……………………………..












Answers

1. c
2. d
3. 2348
4. 1-b, 2-c, 3-d, 4-a
5. 14375
6. 6000
7. d
8. a
9. PUSH-5, POP-5
10. d
11. stacks
12. c
13. ///**↑a↑bcdefgh
14. a
15. c a d b
16. 5
17. 14
18. circular queue takes optimum utilization of the space whereas in the linear queue when the rear pointer reaches maximum position, no more elements can be added in the queue even if the positions preceding it are empty.
19. c
20. 6, 2
21. d
22. b
23. d
24.
25. Lexicographic ordering

No comments: