Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DementiaSort

Dementia sort is an esoteric sorting algorithm that basically one of the most inefficient way of sorting. Where the sorting function somehow develops dementia as the name suggests. Obviously this is the best sorting algorithm that a guy has ever created. It should be used on everything, even in the most important places in your code. Your friends will be so impressed by merely seeing this function, that they'll forget about it!

Background

I created this sorting algorithm because I got interested/invested in sorting algorithms. Especially in some esoteric sorting algorithms, their the most inefficient and stupid way sorting stuff and I love it with all my heart. I decided "hey, why not make my own shitty sorting algorithm", and that's what I did.

How does it work?

The functions develops dementia, when you try to sort it. The function tries its best but ultimately forgot it even started sorting in the first place. It goes on and on until the function finally sorted the elements completely or does it?

Time Complexity

Note

This is just an estimated guess on the time complexity of this sorting algorithm.

Cases Time Complexity Description
Best $O(n)$ Best case scenario, if all the elements within the memories array contains actual contain real numbers, instead of undefined values.
Average $O(n^2)$ Average case, if some the memories array elements have an average undefined values present within.
Worst $O(n^2)$ Worst case, if all of the elements memories array elements are undefined values. It just takes longer to sort through.

About

Greatest sorting algorithm of all time

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages