Javatpoint Logo
Javatpoint Logo

Stack

Algorithm

Pop an element

  • STEP 1 START
  • STEP 2 Check if top== (-1) then stack is empty else goto step 4
  • STEP 3 Access the element top is pointing num = stk[top];
  • STEP 4 Decrease the top by 1 top = top-1;
  • STEP 6 STOP
DS pop

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