Cycle Sort Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Cycle Sort”.

1. Which of the following is an example of an unstable sorting algorithm?
a) cycle sort
b) insertion sort
c) bubble sort
d) merge sort
View Answer

Answer: a
Explanation: Out of the given options only cycle sort is an unstable sorting algorithm. This implies that the relative position of equal valued elements in the input and sorted array does not remain the same when we use cycle sort.

2. What is the worst case time complexity of cycle sort?
a) O(n)
b) O(log n)
c) O(n log n)
d) O(n2)
View Answer

Answer: d
Explanation: The worst case performance of cycle sort is O(n2). It is because it has to make n comparisons for each element of the array.

3. What is the auxiliary space requirement of cycle sort?
a) O(n)
b) O(1)
c) O(log n)
d) O(n log n)
View Answer

Answer: b
Explanation: Cycle sort requires an auxiliary space of O(1). So this makes it an in-place sorting algorithm.
advertisement
advertisement

4. What is the best case time complexity of cycle sort?
a) O(n2)
b) O(n)
c) O(n log n)
d) O(1)
View Answer

Answer: a
Explanation: Best case time complexity of cycle sort is O(n2). This shows that cycle sort is not an adaptive sorting algorithm and thus makes it undesirable when the given array is already almost sorted.

5. What is the average case time complexity of cycle sort?
a) O(n2)
b) O(n log n)
c) O(log n)
d) O(n)
View Answer

Answer: a
Explanation: The average case performance of cycle sort is O(n2). It is because it has to make n comparisons for each element of the array.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Cycle sort is an adaptive sorting algorithm.
a) true
b) false
View Answer

Answer: b
Explanation: The time complexity of cycle sort is O(n2) in any case. So cycle sort algorithm is not adaptive, as it will take the same time to sort an already sorted array and any other randomly arranged array.

7. Which of the following sorting algorithm is in-place?
a) Merge sort
b) Cycle sort
c) Counting sort
d) Radix sort
View Answer

Answer: b
Explanation: Cycle sort has an auxiliary space complexity of O(1). So it qualifies to be an in-place sort. All other given options are not in place sorting algorithm.
advertisement

8. Which of the following is an advantage of cycle sort?
a) it can sort large arrays efficiently
b) it has a low time complexity
c) it requires minimal write operations
d) it is an adaptive sorting algorithm
View Answer

Answer: c
Explanation: Cycle sort is a slow sorting algorithm as compared to quick sort, merge sort etc. and is also not adaptive. But it offers an advantage that it performs minimal write operations which can be very useful in a situation where the write operation is expensive.

9. Cycle sort is a comparison based sort.
a) true
b) false
View Answer

Answer: a
Explanation: Cycle sort is a comparison based sorting algorithm. This is because it compares elements in order to sort them.
advertisement

10. Which of the following sorting algorithm uses the method of insertion?
a) cycle sort
b) bubble sort
c) quick sort
d) selection sort
View Answer

Answer: a
Explanation: Cycle sort is the only algorithm from the given ones that uses the method of insertion. Other than this, insertion sort also uses the method of insertion for sorting.

11. How many write operations will be required to sort the array arr={2,4,3,5,1} using cycle sort?
a) 4
b) 5
c) 6
d) 3
View Answer

Answer: a
Explanation: Cycle sort requires a minimum number of write operations in order to sort a given array. So in this case, only 4 write operations will be required.

12. Which of the following algorithm is best suited for the case where swap operation is expensive?
a) bubble sort
b) cycle sort
c) cocktail sort
d) merge sort
View Answer

Answer: b
Explanation: Cycle sort is a slow sorting algorithm but it requires a minimum number of write operations in order to sort a given array. So it is useful when the write/swap operation is expensive.

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.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.