Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
13
Task/Queue-Usage/Pluto/queue-usage.pluto
Normal file
13
Task/Queue-Usage/Pluto/queue-usage.pluto
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
require "queue"
|
||||
|
||||
local q = new queue()
|
||||
q:push(1)
|
||||
q:push(2)
|
||||
print($"Queue contains {q:toarray():concat(", ")}")
|
||||
print($"Number of elements in queue = {q:size()}")
|
||||
local item = q:pop()
|
||||
print($"'{item}' popped from the queue")
|
||||
print($"First element is now {q:peek()}")
|
||||
q:clear()
|
||||
print("Queue cleared")
|
||||
print($"Is queue now empty? {q:empty() ? "yes" : "no"}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue