Advertisement
Davencode

Untitled

Oct 27th, 2021
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. ALGOIT(T,L)
  2. STL=STX=STP=LAST=NIL
  3. CT=T
  4. while(ct!=NIl || st!=NIL)do
  5. if(ct!=NIL)then
  6. p=ct->k%2
  7. stp=push(stp,cp)
  8. st=push(st,ct)
  9. ct=ct->dx
  10. else
  11. ct=top(st); cp=top(stp)
  12. if(last!=ct->sx && ct->sx!=NIL)then
  13. Ld=val
  14. if(p=0)then
  15. x=new_node(ct->k)
  16. stx=push(stx,x)
  17. stl=push(stl,l)
  18. ct=ct->sx
  19. L=x
  20. else
  21. ct=ct->sx
  22. L=LD
  23. else
  24. if(ct->sx=NIL)then
  25. Ld=val
  26. if(p=0)then
  27. x=new_node(ct->k)
  28. L=NIL
  29. x->next=LD
  30. + uscita algo
  31. else
  32. L=NIL
  33. + uscita algo
  34. else
  35. if(p=0)then
  36. L=val
  37. top(stx)->next=Ld
  38. + uscita algo
  39. else
  40. L=val
  41. + uscita algo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement