Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Var
- CA,CB:Boolean;
- Q:Byte;
- O,T:Queue;
- max:Integer;
- Begin
- CA:=false;
- CB:=false;
- Q:=2;
- max:=10;
- Process 1
- while true do
- begin
- CA:=true;
- 1:
- if CB then
- if Q=1 then goto 1
- else
- begin
- CA:=false;
- while Q=2 do;
- end
- else
- begin
- if O.size() <> max then
- if T.size > 0 then
- O.add(T.peek())
- Q:=2;
- CA:=false;
- end
- end;
- Process 2
- while true do
- begin
- CB:=true;
- 2:
- if CA then
- if Q=2 then goto 2
- else
- begin
- CB:=false;
- while Q=1 do;
- end
- else
- begin
- if O.size() > 0 then
- O.pop();
- Q:=1;
- CB:=false;
- end
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement