d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Question About Sorting
12Next
Add Reply New Topic New Poll
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Aug 1 2013 05:27pm
I'm relatively new to Sorting in Java, but I have trouble finding out which is more efficient: QuickSort , MergeSort, Heapsort. It looks like they share the same average case, while heap and merge have better worst case. Wouldn't I be safe to assume that heap is generally better to use, since merge uses extra memory? When would Heapsort be less advantageous than the other two?

This post was edited by oOn on Aug 1 2013 05:27pm
Member
Posts: 29,723
Joined: Jun 11 2007
Gold: 279.52
Aug 1 2013 07:30pm
Bubble.
Member
Posts: 1,358
Joined: Dec 30 2012
Gold: 0.10
Member
Posts: 2,579
Joined: Jun 1 2012
Gold: 1,524.00
Aug 1 2013 09:33pm


Relevant video I enjoyed

This post was edited by Schwag on Aug 1 2013 09:36pm
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Aug 1 2013 09:45pm
Quote (Schwag @ Aug 1 2013 10:33pm)
http://www.youtube.com/watch?v=kPRA0W1kECg

Relevant video I enjoyed


saw this last night

radix sort lsd mega sex
Member
Posts: 11,610
Joined: Oct 28 2008
Gold: 1,795.00
Aug 1 2013 11:24pm
Ruby sort
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Aug 2 2013 07:23am
Quote (Schwag @ Aug 1 2013 08:33pm)
http://www.youtube.com/watch?v=kPRA0W1kECg

Relevant video I enjoyed


lol i guess he gave up on the bogo sort

also failed to include these classics:
http://xkcd.com/1185/

This post was edited by Azrad on Aug 2 2013 07:25am
Member
Posts: 18,620
Joined: Jul 26 2008
Gold: 777.00
Aug 2 2013 08:21am
Quote (Schwag @ Aug 1 2013 07:33pm)
http://www.youtube.com/watch?v=kPRA0W1kECg

Relevant video I enjoyed


enjoyed
Member
Posts: 5,988
Joined: May 6 2006
Gold: 30.00
Aug 2 2013 02:53pm
You guys aren't helping.
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Aug 2 2013 03:21pm
Quote (oOn @ Aug 2 2013 01:53pm)
You guys aren't helping.


because there is no simple answer. It depends on what you are doing (what you are sorting, and how much you are sorting).

Under the right conditions, bubble and even bogo sort can actually beat other methods!

This post was edited by Azrad on Aug 2 2013 03:33pm
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll