Stack in C# — a practical guide to C# Stack with clear examples you can reuse in real projects.
C# Tutorial Series (78/121). Prefer one article? Read the complete C# tutorial.
Short description
Useful for undo stacks and depth-first algorithms.
Stack
var st = new Stack<int>();
st.Push(1);
var top = st.Pop();