Ask your own question, for FREE!
Mathematics 21 Online
OpenStudy (anonymous):

What is the best algorithm to sort a million 32 bit integers (each unique and ranging from 1-1000000)? I think timsort does it, but how does quicksort or mergesort or some other sorting algorithm compare with respect to the task?

OpenStudy (anonymous):

CS question?

OpenStudy (anonymous):

Yeah.

OpenStudy (anonymous):

so post it there :P

OpenStudy (anonymous):

but maybe JamesJ knows the answer.

OpenStudy (anonymous):

you can ask him in chat! tadam

OpenStudy (anonymous):

because Mathematics and Computer Science are like non-identical twins.

OpenStudy (anonymous):

.... siblings! that's the word

OpenStudy (anonymous):

BINARY SEARCH WOULD BE THE MOST SUITABLE FOR SUCH A LARGE NUMBER OF DATA

OpenStudy (anonymous):

It won't be effective on an unsorted list :-P

OpenStudy (anonymous):

The task is to sort a list, not to search for an element in the list.

OpenStudy (anonymous):

oh, sorry! for sorting, i think quick sort would be good....

OpenStudy (anonymous):

you check it @ http://en.wikipedia.org/wiki/Sorting_algorithm to view which on is more effective on what basis

OpenStudy (anonymous):

don't think! justify! :D

OpenStudy (anonymous):

every sorting algorithms have few advantages and many disadvantages.....you can compare all the algorithms which one is more effective on what basis @ wikipedia http://en.wikipedia.org/wiki/Sorting_algorithm

OpenStudy (anonymous):

I think timsort would be the way to go: http://svn.python.org/projects/python/trunk/Objects/listobject.c

OpenStudy (anonymous):

that code is for Lists in Python (written in C)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!