You are on page 1of 2

1

In an array representation of binary tree the right child of root will be at location of (a) 2 (b) 5 (c) 5 (d) 0 The result of evaluating prefix expression */b+-dacd, where a = 3, b = 6, c = 1, d = 5 is (a) 0 (b) 5 (c)10 (d) 15 In linked lists there are no NULL links in: a. Single linked list b. Linear doubly linked list c. circular linked list d. None of the above The total number of comparisons in a bubble sort is a. O(n log n) b. O(2n) c. O(n2) d. None of the above The dummy header in linked list contain a. First record of the actual data b. Last record of the actual data c. Pointer to the last record of the actual data d. None of the above Which of the following is not true concerning hash tables? a. An advantage of using hash tables is constant search time. b. A disadvantage of hash tables implemented as arrays is the need to know the amount of data in advance. c. An advantage of hash tables is that data can be accessed in order. d. The load factor of a hash table should never be more than 1/2 to 2/3 when open addressing is used. Which of the following statements concerning binary search trees is always true? a. The search time is O(log2 n). b. They are always balanced. c. The delete time is O(log2 n). d. The insert time depends on how well balanced they are. Which of the following statements is true regarding a queue? a. It may be implemented either by an array or a linked list. b. It may be implemented by a heap because first in is first out. c. It may be implemented by a linked list because insertions and deletions may be from the same end. d. It may be implemented by an array without providing for wrap-around Which of the following statements is true? a. An abstract data type can be conveniently searched for an item by key. b. An abstract data type can be conveniently traversed. c. An abstract data type is an interface within a program that simplifies problems. d. An abstract data type is a database for direct user-accessible data. What is the minimum height of a binary tree with 31 nodes?

10

The minimum height of a binary search tree containing n nodes is: a. n - 1 b. (int) log2 n c. n d. no. levels + 1 If the amount of data to be stored in a stack cannot be predicted, the best data structure to implement the stack is: a. hash table b. binary search tree c. linked list d. unordered array In an abstract data type, access is often limited to certain items. Which of the following is not such an abstract data type? a. binary search tree b. priority queue c. queue d. stack Which of the following is true regarding the efficiency of the shell sort ? a. It is slower than O(n2). b. It is faster than O(n*log2 n). c. It is not as efficient as the insertion sort. d. It has not been established theoretically, i.e. as a single function of n. Which of the following methods of implementing a priority queue is best when both insertion and deletion need to be reasonably fast? a. ordered array b. ordered linked list c. heap d. binary search tree Which of the following is not true about a binary expression tree? a. All the internal nodes are operators. b. All operands are leaves. c. All data is stored following the rule: left subtree < root < right subtree. d. All nodes have exactly 0 or 2 children. Which of the following sorts does not operate in O(n*log2 n) time? a. quicksort b. mergesort c. heapsort d. hashsort The __________________ sort is good for almost-sorted files, operating in O(n) time if not too many items are out of place. a. insertion b. bubble c. selection quicksort In an abstract data type, access is often limited to certain items. Which of the following is not such an abstract data type? a. binary search tree e. priority queue f. queue g. stack Which of the following sorts is not efficient in use of storage because it requires an extra array? a. quicksort b. mergesort c. heapsort d. insertion sort

10

You might also like