Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def verifica(A,B):
- return verifica2(A,B) >= 2
- def verifica2(A,B):
- if empty(A):
- return 0
- conta = 0
- if contenuto(B,info(a)):
- conta += 1
- return conta + verifica2(left(A),B) + verifica2(right(A),B)
- def contenuto(A,v):
- if empty(A):
- return False
- if info(A) == v:
- return True
- return contenuto(left(A),v) or contenuto(right(A),v)
Advertisement
Add Comment
Please, Sign In to add comment