Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
19
Task/Queue-Definition/Ring/queue-definition.ring
Normal file
19
Task/Queue-Definition/Ring/queue-definition.ring
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# Project : Queue/Definition
|
||||
|
||||
load "stdlib.ring"
|
||||
oQueue = new Queue
|
||||
for n = 5 to 7
|
||||
see "Push: " + n + nl
|
||||
oQueue.add(n)
|
||||
next
|
||||
see "Pop: " + oQueue.remove() + nl
|
||||
see "Push: 8" + nl
|
||||
oQueue.add(8)
|
||||
see "Pop: " + oQueue.remove() + nl
|
||||
see "Pop: " + oQueue.remove() + nl
|
||||
see "Pop: " + oQueue.remove() + nl
|
||||
if len(oQueue) != 0
|
||||
oQueue.print()
|
||||
else
|
||||
see "Error: queue is empty" + nl
|
||||
ok
|
||||
Loading…
Add table
Add a link
Reference in a new issue