Javatpoint Logo
Javatpoint Logo

Stack

Algorithm

Push an element

  • STEP 1 START
  • STEP 2 Store the element to push into array
  • STEP 3 Check if top== (MAXSIZE-1) then stack is full else goto step 4
  • STEP 4 Increment top as top = top+1
  • STEP 5 Add element to the position stk[top]=num
  • STEP 6 STOP
DS push

Program

Output

Next Topic#





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA