Welcome to BrutrussSort, the sorting algorithm you never knew you needed, and quite possibly, you never will. This is the epitome of brute force sorting, crafted with the finest disregard for efficiency and performance.
BrutrussSort (also known as RussianRoulette-BruteForce-Sort) is the sorting algorithm that takes the scenic route. Instead of fancy optimizations or efficient sorting, it uses pure, unadulterated recursion and a healthy dose of brute force. If you ever wondered how to sort an array by trying almost every possible combination, you're in for a treat!
- Check if the Array is Sorted: First, we check if the array is sorted. If by some miracle it is, we call it a day.
- Recursive Madness: If it's not sorted, we dive into the depths of recursion, trying to sort the array by incrementing the current index.
- Swap Till You Drop: When the recursive call fails to sort the array, we swap elements like there's no tomorrow and recurse again. And again. And again.
- Educational Value: Teach your CPU the value of hard work. It’ll be busy for a while.
- Patience Training: Improve your patience and mindfulness as you watch the algorithm sort an array of 10 elements in minutes, hours, or possibly days.
- Guaranteed Results: BrutrussSort guarantees that your array will be sorted eventually. We're not saying it’ll be quick, but it will get there.
- Cookie Contest: You may win a cookie in case you hit a StackOverflowException with the console app.