Repository navigation
Recursion tree: show argument values, not the class and this pointer - #35
Merged
Merged
Conversation
Method calls such as Solution::towerOfHanoi were labelled with their class and the hidden this pointer, e.g. "Solution::towerOfHanoi(0x5ffdef, 1, ...)", and full nodes cut labels at 15 characters, so every node read "Solution::towe..." and no value was visible. Labels now leave out `this` and the class qualifier, and nodes grow to fit up to 32 characters. The running-call name in the top bar is shortened the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
For a method such as LeetCode's
Solution::towerOfHanoi, each recursion-tree node was labelledThe first "argument" is the hidden
thispointer, which is a memory address. Full-size nodes also cut labels at 15 characters, so every node readSolution::towe…and none of the argument values were visible. The top bar showedSolution::tower…too.Fix
this. Nobody passes it, and its address changes every run.towerOfHanoi(2, "B", "C", "A"). Plain functions are unchanged. The Call stack keeps the full name.×2no longer touches the label.The "Repeated work" grouping now matches calls on their real arguments, without the
thisaddress.Checks
n = 3): nodes readtowerOfHanoi(1, "B", "A", "C"),towerOfHanoi(0, "C", "A", "B") ×2, and so on. The sticky note says towerOfHanoi(0, "C", "A", "B") is running.tsc,npm run buildand the 13 Node tests pass.docs/usage.mddescribes the labels.🤖 Generated with Claude Code