Zen,
I am not following your logic of
< goes on left
> goes on right
Code:
k
/ \
e y
/ \ / \
b <------ I get this to this point
why would the "o" then go to the right of 'parent y' instead of
'parent e' if e is the same node we are on after placement of
'b'???
Why wouldn't each letter be moved to the next child of same node if it fits the rule, else go to node on same level and fit in child of that node that it fits, then if that level is full and letter coming in doesn't fit rule for any node on that level go to the next level of nodes until all are placed?? Is there a rule I am missing/forgeting about filling in children and leaving too many "leaves" open??
Code:
k
/ \
/ \
e y
/ \ / \
/ \ / \
b o a
/ \ / \ / \
/ \ / \ / \
r d i
/ \ /\
/ \/ \
n g