bug in mwFixedRecSort
Brought to you by:
rossjudson
In mwFixedREcSort line 295 :
procedure TM3Array.QuickSortEx(SorCompare: TMergeCompareEx);
var Left, Right, SubArray, SubLeft, SubRight:LongInt;
Temp, Pivot: Pointer;
Stack : array[1..32] of record First, Last : LongInt; end;
1..32 is way to small for sorting (ascending) a DArray of 100.000 elements if the DArray is in descending order.
(EAccessViolation with message 'access violation at address ....')
64 was ok for 100.000 elements, but gave problemns with
200.000 elements.
I think this array should be dynamic so it can grow as necessary in exceptional cases.
Tony.
Logged In: NO
No, it's not. The algorithm is flawed, as I already mailed
once. The shortest sub-array should be sorted first,
then you'll never need more than 2log(n) stack depth.
Stephan Eggermont
Sensus, systems that make sense