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:
@@ -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 }'
|
||||
|
||||
Reference in New Issue
Block a user