mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Update bst string representation method (#92)
__repr__ is also used by __str__, but not vice versa.
This commit is contained in:
parent
a868f1e597
commit
0e866dc7c0
|
@ -6,7 +6,7 @@ class Node(object):
|
||||||
self.right = None
|
self.right = None
|
||||||
self.parent = None
|
self.parent = None
|
||||||
|
|
||||||
def __str__(self):
|
def __repr__(self):
|
||||||
return str(self.data)
|
return str(self.data)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
" self.right = None\n",
|
" self.right = None\n",
|
||||||
" self.parent = None\n",
|
" self.parent = None\n",
|
||||||
"\n",
|
"\n",
|
||||||
" def __str__(self):\n",
|
" def __repr__(self):\n",
|
||||||
" return str(self.data)\n",
|
" return str(self.data)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user