Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Stack/C-sharp/stack.cs
Normal file
13
Task/Stack/C-sharp/stack.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Non-Generic Stack
|
||||
System.Collections.Stack stack = new System.Collections.Stack();
|
||||
stack.Push( obj );
|
||||
bool isEmpty = stack.Count == 0;
|
||||
object top = stack.Peek(); // Peek without Popping.
|
||||
top = stack.Pop();
|
||||
|
||||
// Generic Stack
|
||||
System.Collections.Generic.Stack<Foo> stack = new System.Collections.Generic.Stack<Foo>();
|
||||
stack.Push(new Foo());
|
||||
bool isEmpty = stack.Count == 0;
|
||||
Foo top = stack.Peek(); // Peek without Popping.
|
||||
top = stack.Pop();
|
||||
Loading…
Add table
Add a link
Reference in a new issue