AA with complex keytype?
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Fri Feb 9 16:21:09 PST 2007
Manfred Nowak wrote:
> Frits van Bommel wrote
>
>> Are
>> you sure that an opCmp that never returns "greater" (or,
>> equivalently, never returns "less") will always work?
> Such an opCmp requires the absence of rebalancing operations. And there
> have to go some kudos to Walter for that being true.
Doesn't it also require that objects are always passed in the same
parameter order to the comparison function?
So when comparing two concrete objects a and b, you must always do
compare(a, b), never compare(b, a). No matter which is the one you're
looking for and which is the element in the tree.
More information about the Digitalmars-d
mailing list