Re: "Sorting" assignment



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 much
difference between this and bubble sort. At N=10K there was a clear
difference, although bubble sort still took only 0.75secs (at N=100K there's
no contest).

But bubble sort has the huge advantage of being extremely simple. For this
assignment, may be best to get /anything/ working first then worry about
improving the sort speed, although I doubt the test data will be big enough
to show a difference.

--
Bart



.



Relevant Pages

  • Re: "Sorting" assignment
    ... these comments are for Richard Heathfield, ... Every news contains subject and body text. ... Others have commented on the efficiency of Bubble Sort, so I will not do so ... and the teacher was either a dull fellow ...
    (comp.programming)
  • Re: "Sorting" assignment
    ... manage realistic amounts of news, and it appears you ganged up on ... slight twist which in the dozen lines of a bubble sort could be easier to ...
    (comp.programming)
  • Re: "Sorting" assignment
    ... Every news contains subject and body text. ... It sounds like everything has already been read and you want to sort by the ... Index array rather than swapping everything around. ... With bubble sort, when comparing items A and B (A,B are indices into the ...
    (comp.programming)