On a single threaded architecture, I would use the quick sort:
http://en.wikipedia.org/wiki/Quick_sort

On a parallel architecture, I would use Parallel Sorting by Regular
Sampling:
https://agora.cs.illinois.edu/download/attachments/24348363/Sort+ParaProg(Quinn)chpt14.5.pdf

In the case of floating point numbers, usually you hear that you don't
want to directly compare floating point numbers.  For example:

double d1 = 5.0, d2 = 15.0;
d2 = d2 / 3.0
if(d1==d2) ...

In this case, sometimes d1 & d2 might actually be different due to
floating point error.

However, in the case of sorting, I don't believe you need to worry
about this issue.  If d2 was 4.99999, then sorting would simply put
4.99999 before 5.0.


On Oct 18, 5:00 am, shoban <bsbabu...@gmail.com> wrote:
> How will you sort 1 million floating point numbers?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to