Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COYes, I've thought about using other pivot choosing methods including randomized pivots. That isn't the point. Also, notice that yours is both nonrecursive and parallel. Of course it will be faster! I used recursion because it is much simpler to implement and easier for people to quickly understand. My method can be made both nonrecursive and parallel as well. Yes, std::sort is not the fastest, but it provides a common function for comparison. The dual-pivot quicksort, however, is quite fast for being recursive and serial.
      singulars
    2. COSo what is the point exactly? Apparently none, to downvote my response for no reason. Using two pivot methods will be twice the stack overhead, as I pointed out, and also as I pointed out it doesn't gain you anything over existing methods, so what's the point? Apparently none, just as with the question itself.
      singulars
    3. COI downvoted your response because you were comparing apples to oranges. Comparing a nonrecursive, parallel quicksort with a recursive, serial quicksort is meaningless. You didn't even specify how many processors were being used. Using two different pivot methods does not double the number of stack calls - it is the same number of calls as using your basic quicksort. If you add the total number of stack calls to each function (qs1 and qs2) and to a basic quicksort you should get the same number. Also, maybe you missed that this can be used to improve nonrecursive and parallel methods.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload