Advertisement
kompilainenn

Untitled

Sep 6th, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.60 KB | None | 0 0
  1. class BinaryTree:
  2.     def __init__(self):
  3.         self.root = None
  4.        
  5.     def add(self, data):
  6.         if self.root is None:
  7.             self.root = data
  8.         else:
  9.            
  10.        
  11.     def remove(self, data):
  12.         pass
  13.    
  14.     def find(self, data):
  15.         if self.root is None:
  16.             print('Tree is empty')
  17.             return None
  18.         temp_root = self.root
  19.         while
  20.  
  21.  
  22. class BinaryTreeObj:
  23.     def __init__(self, data):
  24.         self.data = data
  25.         self.link_to_root = None
  26.         self.link_to_right = None
  27.         self.link_to_left = None
  28.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement