1.

Auxiliary space used by gnome sort is _________(a) O(1)(b) O(n)(c) O(log n)(d) O(n log n)I have been asked this question in an interview.This key question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II

Answer»

Right CHOICE is (a) O(1)

To explain: Auxiliary space used by gnome SORT is O(1) as it does not use any EXTRA space for MANIPULATING the INPUT. Thus it also qualifies as an in place sorting algorithm.



Discussion

No Comment Found

Related InterviewSolutions