Jump to content

favourite sorting algorithm


jjbrr

What is your favourite sorting algorithm?  

23 members have voted

  1. 1. What is your favourite sorting algorithm?

    • Bubble sort
      0
    • Insertion sort
      3
    • Shell sort
      0
    • Merge sort
      1
    • Heapsort
      1
    • Quicksort
      6
    • Counting Sort
      0
    • Bucket sort
      1
    • Radix sort
      0
    • Distribution sort
      0
    • Timsort
      0
    • Cocktail Sort
      1
    • Comb Sort
      0
    • Gnome Sort
      1
    • Binary Tree Sort
      5
    • Library Sort
      0
    • Smoothsort
      0
    • Introsort
      0
    • Patience Sorting
      1
    • Strand Sort
      1
    • Tournament
      2


Recommended Posts

If i had to quickly write up a sort routine from scratch, I'd probably do insertion.

 

I notice that bridge players that use insertion sort to sort their hand do so incredibly slowly (usually this involves leaving all the cards face down and then picking them up one at a time). Then again, I don't know anyone that actually uses bubble sort or the like.

 

For sorting my bridge hand, I use some kind of greedy heuristic thing. I just make random moves that look like they'll result in a more sorted hand until it looks "good enough".

Link to comment
Share on other sites

When there are relatively limited possibilities you can always just go through all of them and count them. This is what I do with my bridge hands (the "count" being 0 or 1), go from Ace of Spades and down from there. I know this has a nice name in informatics but I don't know it.

 

BTW nice British spelling dude.

Link to comment
Share on other sites

I don't know the english names, when it comes to sorting I tend to use the simple find the highests, put it first, find the second highest, put it second

 

wich is the worse sorting method, but simplst to programme normally and I don't care much about performance.

Link to comment
Share on other sites

I definitely have a pattern when I duplicate hands (short suits first).

 

I've never really noticed anything how I sort my hand, other than I do it differently than most other people. Seems I can do it in 3-5 movements usually.

Link to comment
Share on other sites

I use classes that have built-in sort methods and SQL "order by" to sort as much as possible on the database server. I don't care how sorting is implemented.

I used to use SortedSet all the time, but stopped when I noticed a significant performance difference between this and non-sorted classes when dealing with large numbers of records. Now I try to avoid sorting when it's not necessary.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...