davegimo

4a4b

Feb 20th, 2021
528
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n1 = tree(5,40,"mario") #root
  2. n2 = tree(3,10,"giorgio")
  3. n3 = tree(6,70,"francesca")
  4. n4 = tree(7,5,"maria")
  5.  
  6.  
  7. n1.left(n2)
  8. n1.right(n4)
  9. n4.left(n3)
  10.  
  11. n5 = tree(1,7,"mariella")
  12.  
  13. #es 4a inserimento:
  14. inserisci(n1,n5)
  15.  
  16. #es 4b ricerca per età maggiore di:
  17. lista_nodi = cerca_per_eta(n1,21)    
RAW Paste Data