80
Comments
  • 0
    What about explained?
  • 0
    Is there any reason why you wouldn't use the quickest one available?
  • 6
    @jirehstudios I think it depends on the type of data you have which one is faster
  • 9
    @jirehstudios As @polo123qwe said, some are more efficient for different types of data (e.g. if you know most of the data is already sorted or not). Additionally, some exist just because they are easy to implement/understand and others exist just because... well... because we're programmers and we make whatever the heck we want.
  • 1
    And some sort algorithm are not stable ->
    A sorting algorithm is stable if whenever there are two records R and S with the same key and with R appearing before S in the original list, R will appear before S in the sorted list.

    And as example one of the fastes quicksort is an unstable sort
  • 1
    Very nice visual.. Here are my 2 cents: https://visualgo.net/sorting
  • 2
    @jirehstudios in exmaple. Quicksort is devastatingly slow if set is almost sorted (or sorted). It's worst case complexity is O(n^2). But in average it is the fastest :)
Add Comment