Can You Explain About STACK In Data Structures?

4

4 Answers

Anonymous Profile
Anonymous answered
Advantages and disadvantages of stack
JJJJJJ BBBBBB Profile
JJJJJJ BBBBBB answered
A stack is used to implement LIFO (last in, first out) storage of data. The act of storing things on the stack is commonly known as "pushing" and the act of removing things from the stack is know as "popping". An example how a stack would work when storing some numbers:
Push 4
Push 7
Push 5
Push 9

First pop operation return 9
Second pop returns 5
Third pop returns 7
Fourth pop returns 4

Any additional pop request will result in an error. Notice that the elements were returned in the opposite order that they were stored in.
MASROOR AHMED Profile
MASROOR AHMED answered
In data structure stack mean a bundle. E.g. A stacks of data in a table, A stack of books, A stack of CDs.

Answer Question

Anonymous