write algorithm for inserting an element in a stack
Answers
Answered by
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
Accountancy,
3 months ago
Math,
3 months ago
Social Sciences,
6 months ago
Music,
6 months ago
Chemistry,
10 months ago
Science,
10 months ago