Guest User

Untitled

a guest
Mar 26th, 2018
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def find_max(root, my_set, max):
  2.     if root is None: # jeśli może być trzystanowy, lub "if not root" jeśli jest dwustanowy
  3.         if len(my_set) >= max:
  4.             max = len(my_set)
  5.  
  6. my_set.add(root.val)
  7. if my_set.left:
  8.     find_max(root.left, root, max)
  9. if my_set.right:
  10.     find_max(root.right, root, max)
Advertisement
Add Comment
Please, Sign In to add comment