More Mcqs Data Structure and Algorithms [Set 4]
More Mcqs Data Structure and Algorithms [Set 4]
4 of 14 sets
159. Which of the following data structure store the homogeneous data elements?
A. arrays
B. records
C. pointers
D. none
Answer:A
163. A sorted file contains 16 items. Using binary search, the maximum number of
comparisons to search for an item in this file is
A. 15
B. 8
C. 1
D. 4
Answer:D
164. A sort which compares adjacent elements in a list and switches where
necessary is
A. insertion sort
B. heap sort
C. quick sort
D. bubble sort
165. A sort which iteratively passes through a list to exchange the first element
with any element less than it and then repeats with a new first element is called
A. insertion sort
B. selection sort
C. heap sort
D. quick sort
Answer:B
166. The number of swappings needed to sort the numbers 8, 22, 7, 9, 31, 19, 5, 13
in ascending order, using bubble sort is
A. 11
B. 12
C. 13
D. 14
Answer:D
167. A sorting technique that guarantees that records with the same primary key
occurs in the same order in the sorted list as in the original unsorted list is said to
be
A. stable
B. consistent
C. external
D. linear
Answer:A
168. You want to check whether a given set of items is sorted. Which of the
following sorting methods will be most efficient if it is already in sorted order?
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:C
169. Which of the following sorting methods will be the best if number of
swappings done, is the only measure of efficienty?
170. You are asked to sort 15 randomly generated numbers. You should prefer
A. bubble sort
B. selection sort
C. insertion sort
D. merge sort
Answer:A
171. What is the number of swaps required to sort n elements using selection sort,
in the worst case?
A. ?(n)
B. ?(n log n)
C. ?(n2)
D. ?(n2 log n)
Answer:A