File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
- // This sorting function called derpy randomly removes and re-adds elements in order
1
+ /* Derpy Sort is an algorithm to randomly sort an array. It
2
+ * randomly removes and re-adds elements in an array.
3
+
4
+ * The big O on the Derpy Sort is O(N).
5
+ *
6
+ * In the Derpy Sort, we iterate through the length of the array and select a random
7
+ * index. We then remove the element associated with that index and re-add it to the
8
+ * end of the array. After the length of the array has been iterated through, the
9
+ * function then returns the resulting array.
10
+ *
11
+ * This sorting function is impractical and does not provide any purpose other than
12
+ * creating a jumbled mess.
13
+ */
2
14
3
15
function derpySort ( arr ) {
4
16
You can’t perform that action at this time.
0 commit comments