Advertisement
Davencode

Untitled

Aug 28th, 2021
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. 16/10/17
  2. ALGO_IT(T,a,b)
  3. ST=STB=LAST=NIL
  4. CT=T
  5. while(ct!=nil || st!=nil)do
  6. if(ct!=nil)then
  7. if(ct->key>=a & ct->key<=b)then
  8. st=push(st,ct)
  9. ct=ct->sx
  10. b=ct->key
  11. else
  12. cancellatree(ct)
  13. ct=NIL
  14. + uscita dall'algoritmo
  15. else
  16. ct=top(st)
  17. if(last!=ct->dx && ct->dx!=nil)then
  18. ct->sx=val //assegno valore della 1 chiamata
  19. ct=ct->dx
  20. stb=push(stb,b)
  21. a=ct->key //preparazione 2 chiamata
  22. else
  23. if(last=ct->dx)then
  24. ct->dx=val //assegno val dx della chiamata
  25. + uscita dall'algoritmo
  26. else
  27. ct->sx=val
  28. ct->dx=NIL //chiamata non effettuata
  29. + uscita dall'algoritmo
  30. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement