Top 80+ Solved Searching, Sorting and Hashing Techniques MCQ Questions Answer

From 16 to 30 of 59

Q. What is an external sorting algorithm?

a. Algorithm that uses tape or disk during the sort

b. Algorithm that uses main memory during the sort

c. Algorithm that involves swapping

d. Algorithm that are considered ‘in place’

  • a. Algorithm that uses tape or disk during the sort

Q. What is an internal sorting algorithm?

a. Algorithm that uses tape or disk during the sort

b. Algorithm that uses main memory during the sort

c. Algorithm that involves swapping

d. Algorithm that are considered ‘in place’

  • b. Algorithm that uses main memory during the sort

Q. What is the worst case complexity of bubble sort?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. What is the average case complexity of bubble sort?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. Which of the following is not an advantage of optimised bubble sort over other sorting techniquesin case of sorted elements?

a. It is faster

b. Consumes less memory

c. Detects whether the input is already sorted

d. Consumes less time

  • c. Detects whether the input is already sorted

Q. What is the best case efficiency of bubble sort in the improvised version?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • c. O(n)

Q. What is an in-place sorting algorithm?

a. It needs O(1) or O(logn) memory to create auxiliary locations

b. The input is already sorted and in-place

c. It requires additional storage

d. It requires additional space

  • a. It needs O(1) or O(logn) memory to create auxiliary locations

Q. In the following scenarios, when will you use selection sort?

a. The input is already sorted

b. A large file has to be sorted

c. Large values need to be sorted with small keys

d. Small values need to be sorted with large keys

  • c. Large values need to be sorted with small keys

Q. What is the worst case complexity of selection sort?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. What is the advantage of selection sort over other sorting techniques?

a. It requires no additional storage space

b. It is scalable

c. It works best for inputs which are already sorted

d. It is faster than any other sorting technique

  • a. It requires no additional storage space

Q. What is the average case complexity of selection sort?

a. O(nlogn)

b. O(logn)

c. O(n)

d. O(n2)

  • d. O(n2)

Q. What is the disadvantage of selection sort?

a. It requires auxiliary memory

b. It is not scalable

c. It can be used for small keys8

d. It takes linear time to sort the elements

  • b. It is not scalable
Subscribe Now

Get All Updates & News