Junior Collections

What is the time complexity for Push() and Pop() operations in a Stack<T>?

  • Push() → O(1) average, O(n) worst-case (if resizing needed)
  • Pop() → O(1)

These operations are fast and efficient due to the internal array structure.

More from C# Programming Tutorial

All questions for this course