Skip to content

DualPivotQuicksort problem #3

@adem0x

Description

@adem0x

I am not going to claim to understand DPQS (DualPivotQuicksort) algorihm nor the implementation.

All I did was to convert the generic parts to straight forward Cardinal types --so that I could use it in older versions of Delphi.

And, before comparing speeds with the usual QuickSort, I thought I might just test whether DPQS does actually sort things the way it is supposed to.

So, I checked it against QuickSort, BubbleSort and --as well as-- a known-to-be-good presorted array; and it seems DPQS has a problem.

Now.. I am pretty sure I haven't made any typos during generic-to-realtype conversion.

I have enclosed a very small project (just sources); could you please look at it and see what's wrong.

QuickSortUnit.pas.txt
QuickSortDemo.dpr.txt
QuickSortUnit.dfm.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions