Stack: Difference between revisions

Frink
(Added solution for Action!)
(Frink)
Line 3,099:
Is stack empty now : false
</pre>
 
=={{header|Frink}}==
Frink's <CODE>array</CODE> class has all of the methods to make it usable as a stack or a deque. The methods are called <CODE><I>array</I>.push[<I>x</I>]</CODE>, <CODE><I>array</I>.pop[]</CODE>, and <CODE><I>array</I>.isEmpty[]</CODE>
<lang frink>a = new array
a.push[1]
a.push[2]
a.peek[]
while ! isEmpty[a]
println[a.pop[]]</lang>
 
=={{header|Genie}}==
494

edits