What's the fastest and most efficient sorting algorithm in the world?
Right now the fastest I can find is this:
FastQSortAlgorithm.java
Results 1 to 15 of 15
- 19 Mar. 2013 01:06am #1
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.51
Most efficient sorting algorithm?
- 19 Mar. 2013 04:07am #2
It depends on what you are sorting. There are a billion ways to sort something, and depending on what it is and how you want it sorted determines which algorithm is fastest. On top of that, the speed of the algorithm is also determined by the values themselves. The same numbers randomly distributed in two different ways in an array can be sorted at two different speeds by two different algorithms, with each algorithm being faster for half the test.
There is no blanket algorithm. You generally learn a handful of good ones, the concepts for when those algorithms are faster than each other, and then just use whichever one matches your data.
- 19 Mar. 2013 04:39am #3
This, not to mention things like the processor and the programming language.
The Wikipedia page has time complexity listings for different sorting algorithms.I don't get tired.
- 20 Mar. 2013 08:27pm #4
GameChief and Isonyx are both right. Adding to that, it also depends on HOW MUCH DATA you have to sort. For example, Google has to sort A LOT of data. They use a combination of sorting algorithms and parallel processing in order to be able to handle the data. I'm also pretty sure they use custom hardware optimized to sort data efficiently (as in power consumption and sorting speed, etc.).
If you had 10 bytes of data to sort, then you can pretty much do whatever you want to sort it (except BogoSort and stuff like that).
- 21 Mar. 2013 04:56pm #5
Let's not even get into Google's sorting algorithms. Oh my gawd. Those fuckers are geniuses on another level. If Einstein made 50 copies of himself and dedicated their lives to sorting gigantic amounts of data algorithmically, you'd have Google's search algorithms.
- 24 Mar. 2013 05:09pm #6
Well, I wouldn't call them geniuses. They simply hire smart people to spend years researching ways to sort data efficiently. When you have a bunch of smart people focused on a single task for a long time, great things are bound to happen.
- 24 Mar. 2013 05:57pm #7
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.11
- 24 Mar. 2013 06:46pm #8
- 24 Mar. 2013 07:05pm #9
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.72
But isn't that a large quotient of the population? I thought a lot of people have 120+? Like everyone on my robotics team has 120-140 IQs, and I think mine is like 150 or someshit. Idk, my school is really well known for super high grades, most people score in the 30's on the ACT and stuff.
- 24 Mar. 2013 07:14pm #10
1. IQ is not the full extent of intelligence.
2. An IQ of 120-140 isn't "genius" level.
3. The average IQ for a person in the US is about ~100.
4. In theory, someone can have an IQ of 120+ and still be an idiot.
5. The term genius is rather vague. Being an extremely seasoned programmer doesn't necessarily tantamount to being a genius.
- 24 Mar. 2013 10:16pm #11
- 24 Mar. 2013 10:17pm #12
- 24 Mar. 2013 10:44pm #13
I don't entirely agree with that.
1. Not all talented people are considered geniuses. It's the extent of the talent that denotes that. Talent does not always involve congenital intelligence. So genius shouldn't always be directly synonymous with intellect.
2. Psychometrics are more or less one dimensional. They assess things like problem solving that while one genius may not be as good at, the other genius is. I mean, someone who is a genius could have an IQ of 130+, but in my opinion that's not necessarily what being a genius entails.
- 24 Mar. 2013 11:11pm #14
It's two different definitions that use the same word. They're not mutually inclusive definitions.
- 25 Mar. 2013 06:47am #15
A lot of those top companies do, I suppose, hire on intelligence. But it's more than that: it's thinking abstractly and efficiently knowing how to tackle problems (i.e. good problem solving skills). If you're up for it, try out some of these challenges: https://www.hackerrank.com/ (though if you do and opt to take part in some of the competitions, I'd recommend you used a compiled language like c++ rather than an interpreted language like Python. They throw time constraints on the solution depending on the language, but identical algorithms in compiled language are often accepted while interpreted languages exceed the time constraints, unless they've fixed it).
Also, on a somewhat unrelated note, I've often found that people who make boastful claims concerning their IQ have either never been properly tested, or are merely embellishing. Also, most people will tell you that it's by no means an accurate measure of intelligence . Funnily enough, I helped a psych student out with her thesis last semester, and had to take a range of certified IQ tests (though I forget which) under the following conditions:
1. Impromptu test (i.e. she randomly asked me one day at Uni)
2. IQ test with a predetermined time and date (so I could get a proper nights sleep, eat accordingly, etc.)
3. Same as above, though after completing a range of problem solving excercises (that she supplied) for the week prior.
There was close to a 15pt difference in IQ (from #1 to #3), which just goes to further go to show I suppose, how redundant they are.
edit: also, the IQ tests I completed were primarily problem solving and language based, which are two of my strongest traits. There are so many other forms of intelligence that aren't tested.
edit2: also, I suppose I should somewhat contribute to the topic. As others have said there is no single most efficient sorting algorithm. Different algorithms are obviously more advantageous for different use cases. If you have time, it's a good read learning what sort of algorithms are used in some of the newer, high-end languages (i.e. take a look at the algorithms the interpreter uses for Python's sort() function).