MCQOPTIONS
Saved Bookmarks
This section includes 125 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures Mcqs knowledge and support exam preparation. Choose a topic below to get started.
| 101. |
What is the advantage of bubble sort over other sorting techniques? |
| A. | It is faster |
| B. | Consumes less memory |
| C. | Detects whether the input is already sorted |
| D. | All of the mentioned |
| Answer» D. All of the mentioned | |
| 102. |
There is one small error in the following flip routine. Find out which line it is on. |
| A. | Line 3 |
| B. | Line 5 |
| C. | Line 7 |
| D. | Line 9 |
| Answer» D. Line 9 | |
| 103. |
There is one to one correspondence between elements of the _________of the tree. |
| A. | Array and trees |
| B. | Array and nodes |
| C. | Arrays and nodes |
| D. | None of the above |
| Answer» C. Arrays and nodes | |
| 104. |
Time required to merge two sorted lists of size m and n, is |
| A. | (m | n) |
| B. | (m + n) |
| C. | (m log n) |
| D. | (n log m) |
| Answer» C. (m log n) | |
| 105. |
To perform the heap sort, you need to create a tree with all nodes greater than their __________. |
| A. | Sibling |
| B. | Children |
| C. | Parents |
| D. | None of the above |
| Answer» C. Parents | |
| 106. |
To sort many large object or structures, it would be most efficient to |
| A. | Place them in an array and sort the array |
| B. | Place them in a linked list and sort the linked list |
| C. | Place pointers to them in an array and sort the array |
| D. | Place reference to them in and array an sort the array |
| Answer» C. Place pointers to them in an array and sort the array | |
| 107. |
Suppose DATA array contains 1000000 elements. Using the binary search algorithm, one requires only about n comparisons to find the location of an item in the DATA array, then n is |
| A. | 7 |
| B. | 20 |
| C. | 38 |
| D. | 45 |
| Answer» C. 38 | |
| 108. |
The analysis of bubble sort was done as early as_____________. |
| A. | 1956 |
| B. | 1946 |
| C. | 1916 |
| D. | 1936 |
| Answer» B. 1946 | |
| 109. |
The average case of quick sort has order |
| A. | O(n^2) |
| B. | O(n) |
| C. | O(n log n) |
| D. | O(log n) |
| Answer» D. O(log n) | |
| 110. |
The average number of comparisons performed by the merge sort algorithm, in merging two sorted liss of length 2 is |
| A. | 8/3 |
| B. | 8/5 |
| C. | 8/7 |
| D. | 11/7 |
| Answer» B. 8/5 | |
| 111. |
The average number of key comparisons done in successful sequential search in a list of length n is .. |
| A. | Log n |
| B. | (n-1)/2 |
| C. | N/2 |
| D. | (n+1)/2 |
| Answer» E. | |
| 112. |
The average search time of hashing, with linear probing will be less if the load factor |
| A. | Equals one |
| B. | Is for less than one |
| C. | Is for greater than one |
| D. | None of these |
| Answer» C. Is for greater than one | |
| 113. |
The average searching time for Fibonacci search is__________. |
| A. | N(log N) |
| B. | S(log N) |
| C. | O(log N) |
| D. | None of the above |
| Answer» D. None of the above | |
| 114. |
Quick sort is also known as |
| A. | Merge sort |
| B. | Heap sort |
| C. | Bubble sort |
| D. | None of these |
| Answer» E. | |
| 115. |
Quick sort running time depends on the selection of |
| A. | Size of array |
| B. | Pivot element |
| C. | Sequence of values |
| D. | None of the above |
| Answer» C. Sequence of values | |
| 116. |
Searching refers to an operation of finding the location of an item in a_______. |
| A. | Table |
| B. | File |
| C. | Both (a) and (b) |
| D. | Column |
| Answer» D. Column | |
| 117. |
Select the appropriate code that performs bubble sort. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» B. B | |
| 118. |
Select the appropriate code that performs selection sort. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» B. B | |
| 119. |
Select the appropriate recursive call for QuickSort.(arr is the array, low is the starting index and high is the ending index of the array, partition returns the pivot element) |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» B. B | |
| 120. |
Brute-force search, commonly known as_________. |
| A. | Naive algorithm |
| B. | Uninformed algorithm |
| C. | Both (a) and (b) |
| D. | Search algorithm |
| Answer» D. Search algorithm | |
| 121. |
Choose among the following code for an iterative binary search. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» C. C | |
| 122. |
Choose the appropriate code that does binary search using recursion. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» B. B | |
| 123. |
Choose the appropriate code snippet that performs uniform binary search. |
| A. | A |
| B. | B |
| C. | C |
| D. | D |
| Answer» D. D | |
| 124. |
Compared to insertion sort, _________ are more advanced algorithms. |
| A. | Quick sort |
| B. | Heap sort |
| C. | Merge sort |
| D. | All of the above |
| Answer» E. | |
| 125. |
After each iteration in bubble sort: |
| A. | At least one element is at its sorted position |
| B. | One less comparison is made in the next iteration |
| C. | Both a & b are true |
| D. | Neither a nor b is true |
| Answer» B. One less comparison is made in the next iteration | |