In this article, we discuss an iterative and recursive approach to delete the middle element of a stack.
Table of contents:
A brief introduction to StacksProblem StatementIterative ApproachRecursive ApproachTime and Space Complexity Analysis
Pre-requisite:
Stack data structureDelete middle element of QueueA brief introduction to Stacks
A stack is a linear data structure that follows LIFO(last in first out).
Picture a stack of plates, the last to be stacked(push) is the first to be remo...
Published on December 09, 2021 13:08