We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d06b7e3 commit bf38b12Copy full SHA for bf38b12
Counting Sort/CountingSort.playground/Contents.swift
@@ -30,7 +30,7 @@ func countingSort(array: [Int]) throws -> [Int] {
30
// Step 3
31
// Place the element in the final array as per the number of elements before it
32
// Loop through the array in reverse to keep the stability of the new array
33
- // (i.e. 7, is at index 3 and 6, thus in sortedArray the position of 7 at index 3 should be before 7 at index 6
+ // i.e. 7, is at index 3 and 6, thus in sortedArray the position of 7 at index 3 should be before 7 at index 6
34
var sortedArray = [Int](repeating: 0, count: array.count)
35
for index in stride(from: array.count - 1, through: 0, by: -1) {
36
let element = array[index]
0 commit comments