Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DualPivotQuicksort problem #3

Open
adem0x opened this issue Mar 18, 2016 · 0 comments
Open

DualPivotQuicksort problem #3

adem0x opened this issue Mar 18, 2016 · 0 comments

Comments

@adem0x
Copy link

adem0x commented Mar 18, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant