Re: "Sorting" assignment



spinoza1111 wrote:
On Feb 5, 1:01 am, "Bartc" <b...@xxxxxxxxxx> wrote:
spinoza1111 wrote:
On Feb 4, 2:28 am, "Ivica" <prljavi_blu...@xxxxxxxxxxx> wrote:
I am looking at switch case usage and bubblesort?

If you use the bubble sort, your application may be too slow to
manage realistic amounts of news, and it appears you ganged up on
your

<snip sort code>

Yes that's pretty fast, although up to N=1000, I could not detect mu

Hint: draw the curve for x=y**2 or draw the curve for x=log(y) and
rotate it 90 degrees.

Well, increasing N by x10 will I guess increase the Time by x100. But at
what levels of N could it still be useful?

I'd made a claim in this thread that bubble sort's speed might be acceptable
for N in the hundreds. My test (on simple memory-based data and on my
machine) showed this could well be true.

I'd also suggested sorting the data in-place (we don't know how the data is
stored, it could be read-only, or too big to move around), introducing a
slight twist which in the dozen lines of a bubble sort could be easier to
appreciate before attempting a quicksort solution.

--
Bart






.



Relevant Pages

  • Re: "Sorting" assignment
    ... If you use the bubble sort, your application may be too slow to manage ... realistic amounts of news, and it appears you ganged up on your ... although I doubt the test data will be big enough ...
    (comp.programming)
  • Re: "Sorting" assignment
    ... realistic amounts of news, and it appears you ganged up on your ... <snip sort code> ... But bubble sort has the huge advantage of being extremely simple. ...
    (comp.programming)