|
-
Jul 26th, 2017, 04:29 PM
#34
Re: VB6 Dual-Pivot-QuickSort
 Originally Posted by Steve Grant
Olaf you once showed me how to use StrCmpLogicalW(StrPtr(S1),StrPtr(S2)) with a standard QuickSort.
I would now like to use the DualPivot-Quicksort and have tried replacing all the comparisons (If M1<M2) etc with the StrCmpLogicalW equivalent but it is VERY slow. Can you show how you would do it please.
Ok, here's a Variant which is using a CallBack-ClassInstance that implements an IStringCompare-Interface
(so that you can decide on the outside about the String-Comparisons/Collations, by simply passing an appropriately implemented ClassInstance along):
DualPivotQuickSortString.zip
@loquat
Here's the Result compared to the QSort2 you've posted, when both Algos are using the faster of the currently two ClassCallBack-instances
(cCompareBinary - for case-sensitive String-Comparisons - the other one, not used in the Test, is cCompareNoCase):

HTH
Olaf
Last edited by Schmidt; Jul 26th, 2017 at 04:47 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|