History, asked by shreejagowda43, 6 months ago

write algorithm for inserting an element in a stack​

Answers

Answered by allorasharma
3

Answer:

hope it works

Explanation:

hey this a note:

Push operation is used to insert an element into stack. PUSH_STACK (STACK,TOP,MAX,ITEM) Algorithm to push an item into stack. 1) IF TOP = MAX then Print “Stack is full”; Exit; 2) Otherwise TOP: = TOP + 1; /*increment TOP*/ STACK (TOP):= ITEM; 3) End of IF 4) Exit

Similar questions