Skip to content

Commit

Permalink
move documentation to func body
Browse files Browse the repository at this point in the history
  • Loading branch information
abuzeid ibrahim committed Sep 3, 2019
1 parent 92e797a commit 70fdd27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Insertion Sort/InsertionSort.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
///
/// - Parameters:
/// - array: the array of elements to be sorted
/// - sortedArray: copy the array to save stability
/// - isOrderedBefore: returns true if the elements provided are in the corect order
/// - Returns: a sorted array containing the same elements
func insertionSort<T>(_ array: [T], _ isOrderedBefore: (T, T) -> Bool) -> [T] {
guard array.count > 1 else { return array }
/// - sortedArray: copy the array to save stability
var sortedArray = array
for index in 1..<sortedArray.count {
var currentIndex = index
Expand Down

0 comments on commit 70fdd27

Please sign in to comment.