Skip to content

Commit b9f5f62

Browse files
committed
Shell Sort
1 parent 6815825 commit b9f5f62

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Shell Sort/shellsort.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
// SOFTWARE.
2222

2323
func insertionSort(inout list: [Int],start: Int, gap: Int) {
24-
var i: Int
25-
26-
for i = start + gap; i < list.count; i += gap {
24+
for i in (start + gap).stride(to: list.count, by: gap){
2725
let currentValue = list[i]
2826
var pos = i
2927
while pos >= gap && list[pos - gap] > currentValue {

0 commit comments

Comments
 (0)