Make tree visualization more compact
This commit is contained in:
@@ -676,6 +676,9 @@ void lastLeqMulti(Arena &arena, Node *root, std::span<Key> keys,
|
||||
explicit DebugDotPrinter(FILE *file) : file(file) {}
|
||||
|
||||
void print(Node *node) {
|
||||
if (node->child[0] == nullptr && node->child[1] == nullptr) {
|
||||
return;
|
||||
}
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
if (node->child[i] != nullptr) {
|
||||
fprintf(file, " k_%.*s -> k_%.*s;\n", node->len,
|
||||
@@ -702,11 +705,11 @@ void lastLeqMulti(Arena &arena, Node *root, std::span<Key> keys,
|
||||
for (auto iter = extrema(node, false); iter != nullptr;
|
||||
iter = next(iter, true)) {
|
||||
fprintf(file,
|
||||
" k_%.*s [label=\"k=\\\"%.*s\\\" "
|
||||
" k_%.*s [label=\"k=\\\"%.*s\\\"\\n"
|
||||
#if SHOW_PRIORITY
|
||||
"p=%u "
|
||||
"p=%u\\n"
|
||||
#endif
|
||||
"m=%d v=%d r=%d\"];\n",
|
||||
"m=%d\\nv=%d r=%d\"];\n",
|
||||
iter->len, (const char *)(iter + 1), iter->len,
|
||||
(const char *)(iter + 1),
|
||||
#if SHOW_PRIORITY
|
||||
|
Reference in New Issue
Block a user