Re: How to implement heap as a binary tree in lisp?



On Sep 27, 5:09 pm, "andrew.ba...@xxxxxxxxx" <andrew.ba...@xxxxxxxxx>
wrote:

Keep a weight slot in each node. Then you can calculate which
direction to go based on weight. For example
(dir 1) -> :left
(dir 2) -> :right
write out (dir 3, 4, 5, 6, 7) and you'll see the pattern. Then be
sure to update weight on insertion or deletion.

Andrew

By weight do you mean the depth/height of each node? Could you please
elaborate it a bit.
Thanks

.