>Note that in the above Pascal code the line
>
>IF ROOT NIL
>
>should be read as "If ROOT does not equal NIL"
>
>I forgot about how the inequality symbol would be interpreted. Duh, I should have used #.
>
>Sorry,
>
>g
I would like to thank you guys for trying to help me. I finally bought the JOE CELKO's book SQL FOR SMARTIES recommanded by Micheal and it showed exactly what I needed to implement. I'm very happy with the performance achieved with this kind of implementation. To be honest, I would never have thought about something like that. Just for your curiosity, representation looks like
A(1,14)
|
------------------
| |
B(2,7) C(8,13)
| |
---------- ----------
| | | |
D(3,4) E (5,6) F(9,10) G(11,12)
where the first number in parenthesis represents left child and the second one the right child. You can extract each subtree easy by doing a query to get only nodes that are in between the left and the right numbers of a node.
There's some manipulations to do when comes the time to insert a node but it's not so complicated.
Thanks again It helped me a lot!