Re: How to implement heap as a binary tree in lisp?
- From: riahasan85@xxxxxxxxx
- Date: Thu, 27 Sep 2007 17:28:37 -0700
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
.
- Follow-Ups:
- Re: How to implement heap as a binary tree in lisp?
- From: andrew.baine@xxxxxxxxx
- Re: How to implement heap as a binary tree in lisp?
- References:
- How to implement heap as a binary tree in lisp?
- From: riahasan85
- Re: How to implement heap as a binary tree in lisp?
- From: andrew.baine@xxxxxxxxx
- How to implement heap as a binary tree in lisp?
- Prev by Date: Re: declare 64 bit integers?
- Next by Date: Re: Explain why calling a named function conses and lambda doesn't?!?!?!?!
- Previous by thread: Re: How to implement heap as a binary tree in lisp?
- Next by thread: Re: How to implement heap as a binary tree in lisp?
- Index(es):