Skip to content

Instantly share code, notes, and snippets.

@robcthegeek
Created July 22, 2011 13:45
Show Gist options
  • Save robcthegeek/1099482 to your computer and use it in GitHub Desktop.
Save robcthegeek/1099482 to your computer and use it in GitHub Desktop.
Stack - Demo LIFO - Thrown together in Snippet Compiler
In Third
In Second
In First
Press any key to continue...
public static void RunSnippet()
{
var stack = new Stack<string>();
stack.Push("In First");
stack.Push("In Second");
stack.Push("In Third");
while (stack.Count > 0)
{
var s = stack.Pop();
WL(s);
}
WL(stack.Count);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment