class BinaryTree:
def __init__(self,rootObj):
self.root = rootObj
self.leftChild = None
self.rightChild = None
def insertLeft(self,newNode):
if self.leftChild == None:
self.leftChild = BinaryTree(newNode)
else:
print('The leftChild is not None.You can not insert')
Python实现简单二叉树
最新推荐文章于 2024-05-10 09:48:37 发布