Re: "Sorting" assignment



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. Magnify the curve near zero. The quicksort and
similar algorithms take a while to get started, of course, on
overcoming the speed of bubble or interchange sorts.

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: sort functions in python
    ... bogo sort and bozo sort are worse, but bubble sort is still ... It's rather like any divide-and-conquer sorting algorithm being called quicksort. ... The conventional wisdom for low-level languages like assembly and C doesn't necessarily hold for high-level languages like Python. ...
    (comp.lang.python)
  • Re: sort functions in python
    ... insertions/replacements, or where they happen. ... The new sort order for any given ... In the case of bubble sort, I think it's a perfectly fine algorithm to ... of crystals that may grow at varying speeds, and that the sizes of the ...
    (comp.lang.python)
  • Re: problem in solving this.
    ... element is selected and placed at the end of the array. ... It looks like bubble sort to me. ... One swap per pass. ...
    (comp.lang.fortran)
  • Re: Spelling Error Fequency
    ... I fill a collection of data objects from a text file (produced from a ... The 'statistical' inefficiency of the bubble sort is negated by the ... Howard Kaikow reckoned: ...
    (microsoft.public.word.vba.general)
  • 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)