Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CountOddIter(T)
- ST=STRET=STRSX=LAST=NIL
- CT=T
- while(ct!=NIL || st!=NIL)do
- if(ct!=NIL)then
- ret=0
- if(ct->key%2=1)then
- ret=ct->key
- st=push(st,ct)
- stret=push(stret,ret)
- ct=ct->sx
- else
- ct=top(st)
- if(last!=ct->dx && ct->dx!=NIL)then
- rsx=val
- strsx=push(strsx,rsx)
- ct=ct->dx //preparo 2
- else
- if(ct->dx=NIL)then
- rsx=val
- rdx=0
- ret=top(stret)+rsx+rdx
- + uscita
- else
- top(strsx)
- rdx=val
- ret=top(stret)+rsx+rdx
- + uscita
- return ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement