Stack: Difference between revisions

Content deleted Content added
Cleaned up push and pop by removing the need for make-node
Add Brat solution
Line 304:
Cannot pop (h)
Stack is empty</pre>
 
=={{header|Brat}}==
Built in arrays have push, pop, and empty? methods:
 
<lang Brat>stack = []
stack.push 1
stack.push 2
stack.push 3
 
until { stack.empty? } { p stack.pop }</lang>
 
Output:
<pre>3
2
1</pre>
 
=={{header|C}}==