22
anon404
7y

Favorite sorting algorithm?

Comments
  • 13
    Bubble Sort
  • 36
    Whichever one gets used when I call array.sort()
  • 19
    Wow, down voted over a sorting algorithm. Guess to be a true dev I'm supposed to pick the fastest sorting algorithm as my favorite, whatever I like bubbles.
  • 2
    Yo chillax dwag, I was joking
  • 22
    Sleep sort
  • 1
    Those that are in O(n!)
  • 2
    Quick sort 😂
    Just joking, bubble sort FTW
  • 5
    The one that works
  • 6
    @Haxk20 Select Sort
  • 2
    @Haxk20 It's always O(n^2)
  • 4
    @Haxk20 Read about computational complexity. Big-Oh analysis of algorithm efficiency. It's definitely worth your time. (I'm actually happy to be the first to introduce this to you)
  • 4
    @Haxk20 I'll tell you, being only 17 and implementing select sort on your own without knowing is a good sign, keep at it my friend.
  • 0
    @Haxk20 the O as in the letter "Oh" is just a convention, it doesn't denote a function as it seems
  • 3
    Fucksort during an orgy?
  • 4
    Radix sort.
    How it works is really quite neat, and sounds amazing if you play a tone for each access/write!

    Or, less seriously: random sort! 😊
    O(1) best case
    O(n^n) average case...
  • 4
    I can't recall the name, but here it is:

    def sort(arr):
    return [12, 36, 42, 190, 547]
  • 3
    @Letmecode
    While you should always use the best algo for the job, or the one with the best runtime benchmark, some sorting algos are just really interesting.
  • 2
    @Ashkin Some are just beautiful, logically and visually
  • 2
    @ctmalloy Agreed. That's why I picked Radix sort ☺
  • 0
    @Letmecode hehe 😊
  • 2
    @Letmecode you? Stupid? Nah, you're the angriest devRant user (apparently) 🙃
  • 2
    5 star hotels and resorts.
  • 6
    Quantum sort. The only O(n) sorting algorithm.

    Use a true random generator to create a random sort index. If items aren't in order, discard the current universe. All possible arrangements will exist but in different universes. Which means that the list will be ordered.
  • 0
    PizzaSort
  • 0
    Timeout-Sort
  • 1
    Selection/Insertion/Bubble sort when it doesn't really matter.
    QuickSort fine tuned to use O(log n) of stack memory when both speed and memory are important.
    MergeSort when memory is not so important but speed is.
  • 0
  • 3
    This sort

    function sort(initial_array) {
    var ret = [1,2,3,4,5];
    return ret; //there sorted done
    }

    I love it because it's an O(1) algorithm :^)
  • 1
    Merge sort is really graceful, I think it's pretty.

    But I usually use quick sort 'cause it's fast.
  • 0
    @PysKa512 O(n*log(n))
    Very few and only the best algorithms solve any problem in O(log(n)) complexity, and neither of them relates to sorting.
  • 1
    Right now, Counting Sort. O(n), heck yeah!
  • 1
    Bogo sort is best sort
  • 5
    Hope Sort. Just throw in the numbers and hope they will sort themselves eventually.
  • 1
    @apisarenco O(n log n) time complexity, and O(log n) stack space. Time complexity =/= space complexity
  • 0
    @AngryDev and each stack level has O(n) size.
  • 0
    @apisarenco it doesn't matter because you never explicitly store the entire binary tree in the stack - just one path which is O(log n)
Add Comment