From 720b7b054bf146bc669022d54096ce46ad43b645 Mon Sep 17 00:00:00 2001 From: Charlie Moore Date: Mon, 4 Oct 2021 18:49:54 -0400 Subject: [PATCH] Add function documentation to CycleSort --- Sorts/CycleSort.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sorts/CycleSort.js b/Sorts/CycleSort.js index e5e9c1319..5e0f6eab5 100644 --- a/Sorts/CycleSort.js +++ b/Sorts/CycleSort.js @@ -8,6 +8,12 @@ * Wikipedia: https://en.wikipedia.org/wiki/Cycle_sort */ +/** + * cycleSort takes an input array of numbers and returns the array sorted in increasing order. + * + * @param {number[]} list An array of numbers to be sorted. + * @return {number[]} An array of numbers sorted in increasing order. + */ function cycleSort (list) { let writes = 0 for (let cycleStart = 0; cycleStart < list.length; cycleStart++) {