How to do gnome sort using zero based array?

Here is pseudocode for the gnome sort using a zero-based array: procedure gnomeSort (a []): pos := 0 while pos < length(a): if (pos == 0 or a [pos] >= a [pos-1]): pos := pos + 1 else: swap a [pos] and a [pos-1] pos := pos - 1
For More Information Please Refer:


You May Also Like to Read: