Stack
A last-in, first-out collection of objects.
namespace
Systems.Collections.Generic
inheritance
Object
–> Stack<T>
construction
var stk = new Stack<type>();
methods
.Peek() // Return, but do not remove, the element at the top of the stack.
Throws exception on empty stack.
.Pop() // Remove and return the element at the top of the stack.
.Push(elem) // Push elem onto stack.
.TryPeek(out var1) // Return, but do not remove, the element at the top of the stack and store it in var1. Return boolean if peek was successful.