[algogeeks] Re: How will you sort 1 million floating point numbers?

2010-10-18 Thread Dave
@Mohit: I've got 8 gigabytes of main memory. What is 8 megabytes compared to that? Dave On Oct 18, 4:08 am, "MOHIT " wrote: > i think i we shoul use external sort like merge sort because 1 million > number should not be stored in main memory it should be on secondory device > . -- You rece

[algogeeks] Re: How will you sort 1 million floating point numbers?

2010-10-18 Thread Dave
I agree. Use any good sorting algorithm. And regarding the ubiquitous advice against comparing floating point numbers: they are only approximations to real numbers, and most real numbers are not represented exactly as floating point numbers. Therefore, two floating point approximations to the same

[algogeeks] Re: How will you sort 1 million floating point numbers?

2010-10-18 Thread xyombie
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