Stacks are linear data structures that only allow insertion and deletion of elements from one end, called the top. Elements are inserted via a push operation and deleted via a pop operation. Stacks can be implemented using arrays, with a pointer tracking the top element. Common applications of stacks include reversing the order of elements and evaluating mathematical expressions by treating them as a postfix notation.
9548086042 for call girls in Indira Nagar with room service
Introduction to stack
1.
2.
Introduction
Primitive Operations Done On Stack
Representation Of Stack On Array
Diagram Of Stack During Push & Pop Operation
Push Operation (Insertion)
Pop Operation (Deletion)
Applications Of Stack
3. The linear data structure linked lists and array,
allows us to insert and delete elements at any
place in the list,at the beginning,at the end,or in
the middle.
A stack is a linear structure in which assition or
deletion of element takes place at the same end.
This end is often called the top of stack.
4. Stacks can be also be defined as
Abstract Data Types(ADT). A stack of
elements of any particular type is finite
sequence of elements of that type
together
5. 1.
2.
3.
4.
5.
6.
Intialize the stack to be empty.
Determine whether stack is empty or not.
Determine if stack is full or not.
Is stack is not full,then add or insert a new
node at one end of the stack called top.
This operation is called as PUSH.
If the stack is not empty ,then retrieve the
node at its top.
if the stack is not empty,then delete the
node at its top. This is called POP operation.
6. Stacks can be represented in the memory through
arrays. Using this concepts, to maintain a linear array
STACK, a pointer variable Top which contains the
location of top element. The maxstack gives the
maximum no of element in a satck
1
Item 1
2
3
4
5
item2
MAXSTACK
8. Push Operation: The process of adding new
element to the top of the stack is called a push
operation pushing of an element is nothing but
just adding an element to a stack.
Pop Operation: the process of deleting an
element from top of the stack is called pop
operation as deletion takes place from top of
the stack.
9.
One of the simple applications of stack is
reversal of list. As the characteristic of stacks
are reversing the order of the execution.
Which can simply by pushing an individual
characters and when complete line is pushed
into the stack, then the individual elements of
stacks are popped off.