Slashdot Mirror


Sort Linked Lists 10X Faster Than MergeSort

virusfree tells us about a new algorithm that has been developed that the author claims can sort a linked list up to 10 times faster than MergeSort. "BitFast," a member of the Hash algorithms family, is available in C and C++ under the GPL.

2 of 326 comments (clear)

  1. Re:How is this not a radix sort? by Tatarize · · Score: 0, Flamebait

    My question is where the hell does this guy think that 10X faster is, first, impressive, and secondly worth a damn? Has he never heard of time complexity? Merge sort is order O(N(logN)) ten times faster than that and you get O(N(logN)) that's a speed boost if I ever saw one. Finally, this is really a radix sort, which is O(N) because it it is bitwise rather than comparison. That's not ten times faster that is log(N) times faster.

    This isn't amazing, I wrote a radix sort back in college. It's an impressive algorithm. This is just that but crappier. Why not write an even faster integer sorting program.

    void supermegasort(vector <int> &tosort) {
            assert(!farts.stink());
            vector <int> everynumber(1<<(sizeof(int)-1),0);
            for (int i=0;i < tosort.size();i++) everynumber[tosort[i]]++;
            for (int i=0,v=0;i < everynumber.size();i++) for(int q=0;q<everynumber[i];q++)tosort[v++]=i;
    }

    Yeah, negative numbers would be rather... fun. But, note... I asserted that my farts don't stink. So you can't be critical of that great code there.

    --

    It is no longer uncommon to be uncommon.
  2. Re:FROTHY PISS by Brad+Eleven · · Score: 0, Flamebait

    Now, now, VENONA. You're simply experiencing the #1 tradeoff in having above-average intelligence: More of your fellow human beings are simply going appear stupid to you.

    And thank you for having expressed my point of view entirely. The first thing the snap-judgment part of my mind presented me when reading the AC post was, "Probably drives a Hummer, proudly."

    --
    "Press to test."
    (click)
    "Release to detonate."