Davencode

Untitled

Oct 27th, 2021 (edited)
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. ALGO_IT(T)
  2. ST=STX=LAST=NIL
  3. CT=T
  4. while(ct!=NIL || st!=NIL)do
  5. if(ct!=NIL)then
  6. ret=1
  7. st=push(st,ct)
  8. stx=push(stx,x)
  9. ct=ct->dx
  10. else
  11. x=top(stx); ct=top(st)
  12. if(last!=ct->sx && ct->sx!=NIL)then
  13. a=val
  14. sta=push(sta,a)
  15. pop(stx)
  16. x=a+x
  17. stx=push(stx,x)
  18. ct=ct->sx
  19. else
  20. if(ct->sx=NIL)then
  21. a=val
  22. x=a+x
  23. y=1
  24. ret=x*1*ct->key
  25. + uscita
  26. else
  27. y=val
  28. ret=x*y*ct->key
  29. + uscita e pop vari
  30.  
  31.  
Add Comment
Please, Sign In to add comment