Introduction to stack

vaibhav2910 3,163 views 10 slides Jan 05, 2014
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

No description available for this slideshow.


Slide Content

MINI – PROJECT Topic: STACKS. Presented by: VaiBHav Navghare

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 Contents

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. 1. INTRODUCTION

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 Stack As An Abstract Data Type

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. Some Primitive Operation Of Sack

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 2 3 4 5 Representation Of Stacks Through Arrays TOP MAXSTACK Item 1 item2

Diagram Of Stack During Push & Pop Operation PUSH POP B C D E F A B C D E F B C D E F

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. Push & Pop Operation

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. Applications Of Stack

Thanks A Lot…..