Re: [BLACKBOX] AVL Trees

From: [at]} <Robert>
Date: Wed, 7 Sep 2011 19:47:41 +0100

----boundary-LibPST-iamunique-1533584453_-_-
Content-type: text/plain

So that I don't count repeats more than once.

They all go onto the list, but can be recognised after sorting because they have
the same key as their neighbours.


Cheers

Robert


PS - I have convinced myself (fingers crossed!) that Wirth's 'delete' routine
does not care about the input value of its 'h' parameter, and that the signature
can be safely changed from VAR h: BOOLEAN to OUT h: BOOLEAN (and likewise his
'del' routine.


Is OUT a Component Pascal feature, not supported by Oberon 2? I find it useful
to make procedures self-documenting.



On 07/09/2011 07:17 PM, Bob Walkden wrote:
>> then count the list.
> ....
>> I then traverse the ordered list counting distinct entries.

>
> Why do you need a second pass to count them? You should just add 1 when
> you've put a new entry in the list.
>
> Bob


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-1533584453_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFNvIHRoYXQgSSBkb24ndCBjb3VudCByZXBlYXRz
IG1vcmUgdGhhbiBvbmNlLlxwYXINClxwYXINClRoZXkgYWxsIGdvIG9udG8gdGhlIGxpc3QsIGJ1
dCBjYW4gYmUgcmVjb2duaXNlZCBhZnRlciBzb3J0aW5nIGJlY2F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ZlIHB1dCBhIG5ldyBlbnRyeSBpbiB0
aGUgbGlzdC5ccGFyDQo+XHBhcg0KPiBCb2JccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8g
dW5zdWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIg
dG8gTElTVFNFUlZATElTVFMuT0JFUk9OLkNIfX0AAAAAAw==
----boundary-LibPST-iamunique-1533584453_-_---
Received on Wed Sep 07 2011 - 20:47:41 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:11 UTC