mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Added __eq__ method to ensure invert_tree_challenge tests pass.
This commit is contained in:
parent
d60f4a904c
commit
f16c42aa12
|
@ -7,7 +7,10 @@ class Node(object):
|
||||||
self.parent = None
|
self.parent = None
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(self.data)
|
return 'Node<data=%s>' % (self.data,)
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return isinstance(other, Node) and self.data == other.data
|
||||||
|
|
||||||
|
|
||||||
class Bst(object):
|
class Bst(object):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user