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-03-17 15:43:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)