Comments (2)
Since you are using the custom class. You must implement the __repr__
.
For simplicity, let's implement the repr to return the string representation of value
class tree_node():
def __init__(self, val, left=None, right=None):
self.val = val
self.left = left
self.right = right
def __repr__(self):
return str(self.val)
Then the tree looks as follows for dfs(root, 11)
Let's say we want dfs(root, 10)
, the tree looks sth like this
from recursion-tree-visualizer.
Thanks!
from recursion-tree-visualizer.
Related Issues (17)
- Return value HOT 1
- Unexpected Result HOT 2
- Failing when argument is mutated.
- Error Writing Frames - Demo Code Does Not Work HOT 2
- Error while writing fibonacci.png HOT 12
- no output of .png nor .gif HOT 2
- [Feature Request] Std Out Animation HOT 8
- Error while writing fibonacci.png HOT 2
- Unexpected behavior HOT 7
- [feature request] adding decorator to control graph properties HOT 1
- "shape" : "record" causes "Error: bad label format" HOT 2
- Write Documentation
- Question: How to remove main(None) node
- Examples
- Refactor HOT 1
- Feature to recolor the repeated state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recursion-tree-visualizer.