[Data Structure] Stack (Implementation with Array/C++)

Changjin
Jan 9, 2021

Stack is a linear & dynamic data structure with which you can perform different operations. Stack follows FILO(First in Last out) or LIFO(Last in First out) order. Imagine you are piling a bundle of books on a shelf one by one. When you have stacked 10 books, if you want to take out the book that you put for the first time(bottom), you have to pull out all the 9 books above first(Of course, in the real world, I wouldn’t recommend to do that). This exactly follows FILO or LIFO order.

Stack Operations
* push()
* pop()
* peek()
* count()
* isEmpty()
* isFull()

Implementation with C++

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Changjin
Changjin

No responses yet

Write a response