Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Queue-Definition/Zkl/queue-definition-1.zkl
Normal file
6
Task/Queue-Definition/Zkl/queue-definition-1.zkl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class Queue{
|
||||
var [const] q=List();
|
||||
fcn push { q.append(vm.pasteArgs()) }
|
||||
fcn pop { q.pop(0) }
|
||||
fcn empty { q.len()==0 }
|
||||
}
|
||||
5
Task/Queue-Definition/Zkl/queue-definition-2.zkl
Normal file
5
Task/Queue-Definition/Zkl/queue-definition-2.zkl
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
q:=Queue();
|
||||
q.push(1,2,3);
|
||||
q.pop(); //-->1
|
||||
q.empty(); //-->False
|
||||
q.pop();q.pop();q.pop() //-->IndexError thrown
|
||||
Loading…
Add table
Add a link
Reference in a new issue