Ask Question
17 June, 17:32

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

+5
Answers (1)
  1. 17 June, 19:39
    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?
Find an answer to your question ✅ “Whatis the restriction placed on the push operation for an array-based implementation of a stack? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers