From 9515badb758ccc4258ab3ff83969b14067196a4f Mon Sep 17 00:00:00 2001 From: marsonya Date: Mon, 25 Jan 2021 23:50:46 +0530 Subject: [PATCH] Improved main Description comment | Cycle Sort --- Sorts/CycleSort.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sorts/CycleSort.js b/Sorts/CycleSort.js index 585371297..3af85ee64 100644 --- a/Sorts/CycleSort.js +++ b/Sorts/CycleSort.js @@ -1,10 +1,10 @@ -/* -Wikipedia says: Cycle sort is an in-place, unstable sorting algorithm, -a comparison sort that is theoretically optimal in terms of the total -number of writes to the original array, unlike any other in-place sorting -algorithm. It is based on the idea that the permutation to be sorted can -be factored into cycles, which can individually be rotated to give a sorted result. -*/ +/** + * Cycle sort is an in-place, unstable sorting algorithm, + * a comparison sort that is theoretically optimal in terms of the total + * number of writes to the original array, unlike any other in-place sorting + * algorithm. It is based on the idea that the permutation to be sorted can + * be factored into cycles, which can individually be rotated to give a sorted result. + */ function cycleSort (list) { let writes = 0