Davencode

Untitled

Aug 27th, 2021 (edited)
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. ALGO_IT(T,k1,k2,L)
  2. ST=STL'=LAST=NIL
  3. CT=T
  4. while(ct!=nil || st!=nil)do
  5. if(ct!=nil)then
  6. st=push(st,ct)
  7. ct=ct->f1
  8. else
  9. ct=top(st) //risalita
  10. if(last!=ct->f2 && ct->f2 !=nil)then //QUI CATTURO IL PRIMO VALORE F1 E PREPARO F2
  11. L'=val
  12. ct=ct->f2
  13. stl=push(stl,l)
  14. L=L'
  15. else
  16. if(last!=ct->f3)then //QUI CATTURO IL VALORE DI F2 E PREPARO F3
  17. L'=val
  18. stl'=push(stl,l)
  19. L=L'
  20. ct=ct->f3
  21. else //CATTURO F3
  22. L'=val
  23.  
  24. if k1<=T->key<=k2 then
  25. L = ALLOCA_NODO()
  26. L->key = T->key
  27. L->next = L'
  28. +USCITA
  29. else
  30. L = l'
  31. +USCITA
  32. return L
  33.  
Add Comment
Please, Sign In to add comment