Re:Was Rust Worth It?
by jacobgorm on Thursday October 26, 2023 @04:54AM
(#38023302)
Also, a parent field is something you should be able to infer, e.g, keep a stack of parents as you traverse down a search tree following the child pointers, instead of storing parent pointers in the tree nodes.
[ Parent
| on HN ]
Re:Was Rust Worth It?
by akoboldfrying on Thursday October 26, 2023 @05:16AM
(#38023428)
That's assuming you traverse the tree down from the root each time. Often you do, but there are cases where you don't -- e.g., if your goal is to determine the lowest common ancestor of two given nodes.