From 3dd10dbe61016e9f9ea5dd1f8d5a2e63493e972a Mon Sep 17 00:00:00 2001 From: Rak Laptudirm <68542775+raklaptudirm@users.noreply.github.com> Date: Sun, 23 May 2021 21:09:46 +0530 Subject: [PATCH 1/2] Revert "Added Sleep Sort" --- Sorts/SleepSort.js | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Sorts/SleepSort.js diff --git a/Sorts/SleepSort.js b/Sorts/SleepSort.js deleted file mode 100644 index 309f11c22..000000000 --- a/Sorts/SleepSort.js +++ /dev/null @@ -1,18 +0,0 @@ -/*Sleep sort is a sorting algorithm in which, for every element - to be sorted, we set a timeout for the value of that element. - After the timeout is over, we print the value of the element. - Hence the output is printed in the sorted order. -*/ - -Array.prototype.sleepSort = function(callback_function) { - const arr = []; - for (let n of this) - setTimeout(() => { - arr.push(n); - if (this.length === arr.length) - callback_function(arr); - }, n + 1); - return arr; -}; - -[1, 9, 8, 7, 6, 5, 3, 4, 5, 2, 0].sleepSort(console.log); From f9db59f43e13d1eb48733ec8bf957d1f12c2998e Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 23 May 2021 15:40:01 +0000 Subject: [PATCH 2/2] updating DIRECTORY.md --- DIRECTORY.md | 1 - 1 file changed, 1 deletion(-) diff --git a/DIRECTORY.md b/DIRECTORY.md index 0717e9bc7..a827163a5 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -254,7 +254,6 @@ * [SelectionSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/SelectionSort.js) * [SelectionSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/SelectionSort.test.js) * [ShellSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/ShellSort.js) - * [SleepSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/SleepSort.js) * [TimSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/TimSort.js) * [TopologicalSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/TopologicalSort.js) * [WiggleSort](https://github.com/TheAlgorithms/Javascript/blob/master/Sorts/WiggleSort.js)