Created
July 22, 2011 13:45
-
-
Save robcthegeek/1099482 to your computer and use it in GitHub Desktop.
Stack - Demo LIFO - Thrown together in Snippet Compiler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In Third | |
In Second | |
In First | |
Press any key to continue... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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