in reply to Advanced Bubble Sort

It seems to me that most everyone in this thread has completely misunderstood your title: the required "bubble sort" is "advanced" because it only requires a single, linear pass.

Thus O(n) rather than O(n+nlogn); or O(nlogn+nlogn); or O(nlogn)(with a very large constant); or O(MG).

Essentially you were describing a "find the biggest in each subgroup" algorithm; which doesn't involve any actual sorting whatsoever; and doesn't require every line to be compared to every other line, only with those lines with the same prefix; and only once each.

Of course, for the size of the sample data the difference is miniscule; but ...


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: Advanced Bubble Sort (General comment on thread)