.286p
.model small
name Replying_To_A_Message_from_Soren
assume CS:ReplyBody
ReplyBody segment byte public
Soren:
#SP#> How to insert something in the tree and still be sure that the tree is
#SP#> very compact (to enable the fastest search capabilities)
By compact do you mean balanced?
It could certainly be done, though I think you would be wasting your time. In
a worst case scenario, you'd have to re-balance the tree after the addition
of any new node. I expect that the time consumed by the process of
re-balancing, would effectively negate any advantage which you might gain
from searching through a balanced BST as opposed to a BST in its "natural"
state.
#SP#> How to delete a node in the tree.
Very carefully. ;-)
Find the node you wish to delete. If it happens to be a leaf node, you're in
luck, and all you have to do is delete it.
If it is not a leaf node, removing it will result in the creation of either
two or three smaller trees. Now pick one tree, and find the appropriate leaf
at which to attach the other orphaned tree(s) (use the same method you would
to add a node to the tree).
mov ax,4C00h
int 21h
Reply ends
end Soren
... Mary had a little RAM -- only about a MEG or so.
---
---------------
* Origin: Extreme Impossibility/2 [Kingston, Ontario, Canada] (1:249/176)
|