Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scalanie 2 kolejek rosnΔ cych
- SCAL (B,C)
- x=0
- y=0
- while QUEUE-EMPTY(B) == false and QUEUE-EMPTY(C) == false
- do
- if (x==0) and (y==0) do
- x=DEQUEUE(B)
- y=DEQUEUE(C)
- if (x==0) do
- x=DEQUEUE(B)
- else if(y==0) do
- y=DEQUEUE(C)
- if x <= y do
- ENQUEUE(A) = x
- x=0
- else
- ENQUEUE(A) = y
- y=0
- if QUEUE-EMPTY(B) == true then
- while QUEUE-EMPTY(C) != true then
- ENQUEUE(A) = DEQUEUE(C)
- else if QUEUE-EMPTY(C) == true then
- while QUEUE-EMPTY(B) != true then
- ENQUEUE(A) = DEQUEUE(B)
- return A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement