TheAlgorithms / C-Sharp

All algorithms implemented in C#.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The implementation of InsertionSorter is wrong

ramiroezequielalvarez opened this issue · comments

The implementation of InsertionSorter is wrong. It's a copy of selection sort

Wikipedia example (InsersionSort)

i ← 1
while i < length(A)
j ← i
while j > 0 and A[j-1] > A[j]
swap A[j] and A[j-1]
j ← j - 1
end while
i ← i + 1
end while

currently InsertionSorter is equal to SelectionSorter

Please open a PR, it's hard to read code when it's not formatted

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue was closed because it has been stalled for 7 days with no activity.