About 7,160,000 results
Open links in new tab
  1. Stack Class (System.Collections) | Microsoft Learn

    To guarantee the thread safety of the Stack, all operations must be done through the wrapper returned by the Synchronized (Stack) method. Enumerating through a collection is intrinsically …

  2. C# Stack with Examples - GeeksforGeeks

    Jul 11, 2025 · The generic stack is in the System.Collections.Generic namespace, while the non-generic stack is in System.Collections. The stack can dynamically store elements of the same …

  3. C# Stack (With Examples) - Programiz

    A Stack is a generic class that arranges the elements of a specified type using Last In First Out (LIFO) principles. In this tutorial, you will learn about the C# stack with the help of examples.

  4. C# Stack - TutorialsTeacher.com

    Stack is a special type of collection that stores elements in LIFO style (Last In First Out). C# includes the generic Stack<T> and non-generic Stack collection classes.

  5. C# - Stack Examples - Dot Net Perls

    Aug 9, 2025 · The Stack collection, found in the System.Collections.Generic namespace, provides a wrapper on an array. Stack is a useful abstraction of the classic stack data structure.

  6. Working With Stack In C#

    Think of a stack as a collection of items where anything you insert in a stack will be placed at the top and if you need to remove something, it will be removed from the top. A stack of plates or …

  7. C# - Stack Class - Online Tutorials Library

    Gets the number of elements contained in the Stack. The following table lists some of the commonly used methods of the Stack class −. Removes all elements from the Stack. …

  8. C# Stack - C# Tutorial

    In C#, Stack<T> class works the same way as a stack of books. The Stack<T> has two main methods: Push() – places an item on the top of the stack. Pop() – removes the item from the …

  9. Stack<T> Class (System.Collections.Generic) | Microsoft Learn

    The code example creates a stack of strings with default capacity and uses the Push method to push five strings onto the stack. The elements of the stack are enumerated, which does not …

  10. Using a Stack to Solve Problems in C# - by Roy Mraz

    May 19, 2025 · In this post, I’ll explain what a stack is, implement one in C#, and show how to use it to solve two classic interview problems: reversing a string and validating parentheses. What …