Seems to me that this strategy is only really suitable for small trees. For instance to hold a list of N nodes in your tree you need (N+1)*(N/2) records. This means that for even a moderately sized tree you will be dealing with a lot of records. And the sparser the tree the less efficient it will be.
Also, iirc celko algorithm doesn't necessarily require updating all the nodes. And the updates required are simple and efficient. IMO, given that the latter would only hold N records for N nodes Id bet updating it would be more efficient that working with your structure due to scaling.
Anyway, you haven't outlined what operations you need to perform on your trees and how often they occur. Without that info its hard to advise you beyond that your proposed algorithm looks unsatisfactory due to scaling.
Also have you considered how much work needs to be done if you reparent a node? I should think such an operation would be woefully painful given your current structure.
update:Corrections and I removed some needless comments. Shouldnt post before you drink coffee.
In reply to Re: Trees in SQL, adjacency lists and sorting.
by demerphq
in thread Trees in SQL, adjacency lists and sorting.
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |