Skip to content

Commit da34da5

Browse files
committed
changed tab width to 2 spaces instead of 4
1 parent 0e83ef2 commit da34da5

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Bubble Sort/MyPlayground.playground/Sources/BubbleSort.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ import Foundation
2626
/// - Parameter elements: the array to be sorted
2727
/// - Returns: an array with the same elements but in order
2828
public func BubbleSort<T> (_ elements: [T]) -> [T] where T: Comparable {
29-
var array = elements
30-
31-
for i in 0..<array.count {
32-
for j in 1..<array.count-i {
33-
if array[j] < array[j-1] {
34-
let tmp = array[j-1]
35-
array[j-1] = array[j]
36-
array[j] = tmp
37-
}
38-
}
29+
var array = elements
30+
31+
for i in 0..<array.count {
32+
for j in 1..<array.count-i {
33+
if array[j] < array[j-1] {
34+
let tmp = array[j-1]
35+
array[j-1] = array[j]
36+
array[j] = tmp
37+
}
3938
}
40-
41-
return array
39+
}
40+
41+
return array
4242
}

0 commit comments

Comments
 (0)