Skip to content

Commit

Permalink
Minor change in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
JMatharu committed May 31, 2020
1 parent d06b7e3 commit bf38b12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Counting Sort/CountingSort.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func countingSort(array: [Int]) throws -> [Int] {
// Step 3
// Place the element in the final array as per the number of elements before it
// Loop through the array in reverse to keep the stability of the new array
// (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
var sortedArray = [Int](repeating: 0, count: array.count)
for index in stride(from: array.count - 1, through: 0, by: -1) {
let element = array[index]
Expand Down

0 comments on commit bf38b12

Please sign in to comment.