Skip to content

Commit fddb6bb

Browse files
committed
Add support for string node values
1 parent 9595bb7 commit fddb6bb

File tree

6 files changed

+643
-164
lines changed

6 files changed

+643
-164
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ manipulate binary trees. Skip the tedious work of setting up test data, and dive
1414
straight into practising your algorithms. Heaps and BSTs (binary search trees) are
1515
also supported.
1616

17+
Check out the [documentation](http://binarytree.readthedocs.io) for more details.
18+
1719
![IPython Demo](gifs/demo.gif)
1820

1921
Binarytree can be used with [Graphviz](https://graphviz.org) and
@@ -47,7 +49,7 @@ Binarytree uses the following class to represent a node:
4749
class Node:
4850

4951
def __init__(self, value, left=None, right=None):
50-
self.value = value # The node value (integer)
52+
self.value = value # The node value (float/int/str)
5153
self.left = left # Left child
5254
self.right = right # Right child
5355
```
@@ -330,7 +332,7 @@ print(root)
330332
# / \
331333
# 4 5
332334

333-
# First representation is was already shown above.
335+
# First representation is already shown above.
334336
# All "null" nodes in each level are present.
335337
print(root.values)
336338
# [1, 2, None, 3, None, None, None, 4, 5]

0 commit comments

Comments
 (0)