1.

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) 3This question was addressed to me during an online interview.Asked question is from Sorting topic in section Sorting of Data Structures & Algorithms II

Answer»

The correct choice is (a) 4

The best I can explain: 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.



Discussion

No Comment Found

Related InterviewSolutions