Revised Binary Tree, with the pytest file
Finally went through and fixed my spaghetti monster. update(12/21/2020) moved code into 'code blocks'. I will probably be moving this one next to My WordPress site: Nellie's Noodles I might go back and add recursions, but for the purpose of showing readers how I made the code, while loops are much easier to follow, in my opinion. The diagram of how I decided to do delete from a parent node with two children. Python Binary Tree: --Start Code Block-- class BinaryTreeNode(object): def __init__(self, key, value, left, right): self.key = key self.value = value self.left = left self.right = right def __repr__(self): nleft = self.left and self.left.value or None nright = self.right and self.right.value or None return f"{nleft} {nright}" class BinaryTree(object): def __init__(self, median): self.median = median self.root_node = BinaryTreeNode(self.median, 'bina...