Reworked RD-Tree to behave more consistently. The construction of the tree did not allow specifying what index to insert a child at under a parent.

Traverser orders were also broken, which is now fixed.
This commit is contained in:
2025-08-14 17:07:48 -04:00
parent f173c3e7cd
commit 2535e1ac4b
3 changed files with 171 additions and 51 deletions

View File

@@ -171,6 +171,7 @@ class RDTreePrinter:
nprev = self.tree[node]['prev']
nprevc = self.tree[nprev]['child'] if nprev != 18446744073709551615 else 18446744073709551615
child = self.tree[node]['child']
n_chld = self.tree[node]['num_children']
index = '' * depth * 2 # Uses Braille Space, otherwise it would get eaten as whitespace by parsers
@@ -188,7 +189,7 @@ class RDTreePrinter:
index += ''
index += ''
index += '[{}, {}]'.format(i, node)
index += '[{}, {}, {}, {}]'.format(i, node, depth, n_chld)
print(index)
if value is None:
return index, '{ empty }'