GithubHelp home page GithubHelp logo

gerben-s / quicksort-blog-post Goto Github PK

View Code? Open in Web Editor NEW
39.0 4.0 7.0 96 KB

Home Page: https://blog.reverberate.org/2020/05/29/hoares-rebuttal-bubble-sorts-comeback.html

License: Apache License 2.0

Starlark 2.30% C++ 97.70%
quicksort blogpost

quicksort-blog-post's Issues

Quadsort as another idea to benchmark against

At the end of your blog post you've even tried implementing CPU-pipeline-efficient MergeSort. What about enhancing Quadsort (which is MergeSort, but with a tiny sorting network built-in) by your DistributeBackward and DistributeForward approach?

Bad behavior if all elements of array are equal

I pulled this into my code to see how it compared to a sort implementation I was using and found that the tests were hanging. After a little investigation, it wasn't hanging but was just performing very badly for the cases where all elements are equal. Looks like it partiions into subarrays of size 1 and n-1 and continues that all the way down or until it blows up due to too much recursion.

I haven't looked at any fixes, but wanted to know whether that was a known issue with the experimental code or whether that behavior had been overlooked.

Although the test is easy to reproduce, here is the code for completeness:

#include <hybrid_qsort.h>
#include <vector>
int main()
{
  //  std::vector<int> v(131071,1);
  std::vector<int> v(1024,1);
  exp_gerbens::QuickSort(v.data(), v.size());

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.