MULTI_POP(k)
- while not Empty() and k ≠ 0 do
- Pop()
- k ← k-1
RANDOM_STACK_OP
- stack S
- for i ← 1 to n do
- op ← random(1..3)
- if op = 1 then
- S.Push(random Element)
- elif op = 2 then
- S.Pop()
- else
- S.MultiPop(n)
INCREMENT(A)
- i ← 0
- while i < length[A] and A[i]=1 do
- A[i] ← 0
- i ← i + 1
- if i < length[A] then
- A[i] ← 1;