Ask Question
20 June, 06:35

Whatis the restriction placed on the push operation for an array-based implementation of a stack?

+3
Answers (1)
  1. 20 June, 07:33
    0
    if the number of elements in the array are equal to the size of the array then return - 1.

    Explanation:

    We are implementing stack using array. Stack is a LIFO (Last In First Out) type data structure. Insertion and deletion is from one end only.

    So while push operation or inserting elements in the stack using array we have to check that the capacity of array is not reached. If reached then no element can be inserted in the stack. If not then we can insert element in the stack.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Whatis the restriction placed on the push operation for an array-based implementation of a stack? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers