Does anyone know what a gap sort is? Can someone do an example of one?
<p>I know that a <code>gap sort</code> is a variation of a <code>bubble sort</code>. Instead of comparing neighboring elements each time through a list, it compares elements that are some number of positions apart, where the number of positions apart is less then n (number of positions). For example, the <code>first element</code> would be compared to the (<code>i+1)</code> element, the <code>second element</code> would be compared to the <code>(i+2)</code> element, the <code>nth element</code> would be compared to the <code>(n-i)</code> element, etcetera. A single iteration is completed when all of the elements can and are compared. The next iteration i is reduced by some number greater than one and process continues until i is less than one.</p>

<p>This is my understanding of a gap sort but I am having trouble implementing it. Any kind of help would be appreciated. </p>
