Study Korner

Stack – Data Structure

Outline:

Stack – Introduction

Stack -Implementation:

Stack – Implementation – using Array:

                begin procedure push: stack, data
                   if stack is full
                      return null
                   endif
                   top = top + 1
                   stack[top] = data
                end procedure

Stack Push Operation

 

               begin procedure pop: stack 
	           if stack is empty 
		       return null 
	           endif 
	           data = stack[top] 
	           top = top - 1 
	           return data 
                end procedure

Stack POP Operation

Exit mobile version