This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Cubesort”.
1. Which of the following is an example of parallel sorting technique?
a) bogo sort
b) sleep sort
c) cube sort
d) merge sort
View Answer
Explanation: Out of the given options only cube sort is a parallel sorting algorithm. It builds self balancing multi dimensional arrays from the input keys.
2. What is the worst case time complexity of cube sort?
a) O(n)
b) O(log n)
c) O(n log n)
d) O(n2)
View Answer
Explanation: The worst case performance of cube sort is O(n log n). This is the fastest possible complexity with a comparison based sort.
3. What is the auxiliary space requirement of cube sort?
a) O(n)
b) O(1)
c) O(log n)
d) O(n log n)
View Answer
Explanation: Cube sort requires an auxiliary space of O(n). This is the worst case of auxiliary space complexity.
4. What is the best case time complexity of cube sort?
a) O(n2)
b) O(n)
c) O(n log n)
d) O(1)
View Answer
Explanation: Best case time complexity of cube sort occurs when the input array is almost sorted. So in such a case only O(n) time is required for sorting.
5. What is the average case time complexity of cube sort?
a) O(n2)
b) O(n log n)
c) O(log n)
d) O(n)
View Answer
Explanation: The average case performance of cube sort is O(n log n). This is the fastest possible complexity with a comparison based sort.
6. Which of the following algorithm is stable?
a) heap sort
b) cube sort
c) quick sort
d) bogosort
View Answer
Explanation: Out of the given algorithms only cube sort is stable. This implies that the relative position of equal valued elements in the input and sorted array remains the same.
7. Cube sort is an in place sorting algorithm.
a) true
b) false
View Answer
Explanation: Cube sort has an auxiliary space complexity of O(n). So it does not qualify to be an in-place sort.
8. Which of the following is a disadvantage of cube sort?
a) high memory overhead for small data
b) high memory overhead for any data
c) balancing is slow
d) Iteration is slow
View Answer
Explanation: In a general case the memory overhead of cube sort is low. But when the data set is small then in that case the memory overhead becomes high.
9. Cube sort is a comparison based sort.
a) true
b) false
View Answer
Explanation: Cube sort is a comparison based sorting algorithm. This is because it compares elements in order to sort them.
10. Which of the following sorting algorithm uses the method of insertion?
a) cube sort
b) bubble sort
c) quick sort
d) selection sort
View Answer
Explanation: Cube sort is the only algorithm from the given ones that uses the method of insertion. Other than this, the insertion sort also uses the method of insertion for sorting.
Sanfoundry Global Education & Learning Series – Data Structures & Algorithms.
To practice all areas of Data Structures & Algorithms, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Practice Computer Science MCQs
- Practice Programming MCQs
- Practice Data Structure MCQ
- Check Design and Analysis of Algorithms Books
- Apply for Computer Science Internship