Timeline for expressing the speed of a sorting algorithm
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 26, 2014 at 6:07 | comment | added | J Trana | @lamphp You mention that you're wondering how to express the speed of the algorithm. I know folks have done a good job of explaining how fast it is, but I guess I wanted to answer the general question a bit. Usually when you look at an algorithm, you typically try to analyze best-case, worst-case, and average case. If you are trying to communicate this to others, you probably want to list all three to get the full context. Worst case is often what's listed, but average case can be very important. | |
Jan 25, 2014 at 13:39 | answer | added | user7043 | timeline score: 1 | |
Jan 25, 2014 at 13:36 | history | edited | Blrfl | CC BY-SA 3.0 |
Formatting fix
|
Jan 25, 2014 at 13:31 | history | edited | nettie | CC BY-SA 3.0 |
added 21 characters in body
|
Jan 25, 2014 at 13:28 | comment | added | nettie | Yikes! You are absolutely right. Still, I'm wondering how the speed of the above would be represented. I guess the call to array_splice would have to be taken into consideration. | |
Jan 25, 2014 at 13:20 | comment | added | user7043 | Nothing about bubblesort is n^n. Bubblesort only needs n^2 comparisons. n^n is nonsense because there are only n! permutations; even the naive brute-force "check every permutation, stop when one is sorted) only takes n * n! comparisons. | |
Jan 25, 2014 at 13:15 | history | asked | nettie | CC BY-SA 3.0 |