MCPcopy Create free account
hub / github.com/0xAX/go-algorithms / ShellSort

Function ShellSort

sorting/shell_sort.go:6–14  ·  view source on GitHub ↗

* * Shell sort - http://en.wikipedia.org/wiki/Shellsort */

(arr []int)

Source from the content-addressed store, hash-verified

4 * Shell sort - http://en.wikipedia.org/wiki/Shellsort
5 */
6func ShellSort(arr []int) {
7 for d := int(len(arr)/2); d > 0; d /= 2 {
8 for i := d; i < len(arr); i++ {
9 for j := i; j >= d && arr[j-d] > arr[j]; j -= d {
10 arr[j], arr[j-d] = arr[j-d], arr[j]
11 }
12 }
13 }
14}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected