1.

The initial gap between two elements being compared _______(a) is equal to number of elements in the array(b) is equal to 1.3(c) depends on the number of iterations(d) depends on the compiler being usedI have been asked this question during an interview.My enquiry is from Sorting in portion Sorting of Data Structures & Algorithms II

Answer»

The CORRECT option is (a) is equal to NUMBER of elements in the array

The best I can explain: INITIAL gap is TAKEN to be equal to the number of elements in the array and shrinks by a factor of 1.3 in each iteration, initial gap is independent of the number of ITERATIONS and compiler being used.



Discussion

No Comment Found

Related InterviewSolutions