Skip to content

Commit 70fdd27

Browse files
author
abuzeid ibrahim
committed
move documentation to func body
1 parent 92e797a commit 70fdd27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Insertion Sort/InsertionSort.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
///
33
/// - Parameters:
44
/// - array: the array of elements to be sorted
5-
/// - sortedArray: copy the array to save stability
65
/// - isOrderedBefore: returns true if the elements provided are in the corect order
76
/// - Returns: a sorted array containing the same elements
87
func insertionSort<T>(_ array: [T], _ isOrderedBefore: (T, T) -> Bool) -> [T] {
98
guard array.count > 1 else { return array }
9+
/// - sortedArray: copy the array to save stability
1010
var sortedArray = array
1111
for index in 1..<sortedArray.count {
1212
var currentIndex = index

0 commit comments

Comments
 (0)