Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALGO_IT(A,i,j)
- STQ=STJ=STX=STRET=LAST=NIL
- ci=i;
- cj=j;
- while(CI<=CJ || STJ != NILL)do
- if(ci<=cj)then
- x=A[ci]
- y=A[cj]
- ret=0
- q=ci+cj/2
- if(ci < q)then
- STJ=STQ=STRET=PUSH()
- cj=q
- else if(q+1 < cj)then
- STQ=STJ=STRET=PUSH()
- ci=q+1
- else
- +USCITA SOLITA
- else
- top(STJ,STQ)
- if(ci<q)then
- x=val
- ret=top(stret)+val
- pop(stret)
- push(stret,ret)
- else if(q+1<cj)then
- y=val
- ret=top(stret)+val
- pop(stret)
- push(stret,ret)
- else
- +USCITA SOLITA
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement