Advertisement
Davencode

Untitled

Jul 6th, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. ALGO_IT(A,i,j)
  2. STQ=STJ=STX=STRET=LAST=NIL
  3. ci=i;
  4. cj=j;
  5. while(CI<=CJ || STJ != NILL)do
  6. if(ci<=cj)then
  7. x=A[ci]
  8. y=A[cj]
  9. ret=0
  10. q=ci+cj/2
  11. if(ci < q)then
  12. STJ=STQ=STRET=PUSH()
  13. cj=q
  14. else if(q+1 < cj)then
  15. STQ=STJ=STRET=PUSH()
  16. ci=q+1
  17. else
  18. +USCITA SOLITA
  19. else
  20. top(STJ,STQ)
  21. if(ci<q)then
  22. x=val
  23. ret=top(stret)+val
  24. pop(stret)
  25. push(stret,ret)
  26. else if(q+1<cj)then
  27. y=val
  28. ret=top(stret)+val
  29. pop(stret)
  30. push(stret,ret)
  31. else
  32. +USCITA SOLITA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement