jnsoccerboy3269 jnsoccerboy3269
  • 23-08-2019
  • Computers and Technology
contestada

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

Respuesta :

ExieFansler ExieFansler
  • 27-08-2019

Answer:

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.

Answer Link

Otras preguntas

Identify three forces that act on plates to make them move.
the cruiser bicycle company makes two styles of bicycles.he traveler, which sells for $300, and thw tourister,qhich sells$600.each bicycle has the same frame an
in the crucible what conflict does elizabeth experience as her husband seeks her guidance?in the crucible does John Proctor have "no tongue for"?why does procto
how do you increase £480 by 7.5%
Marta is solving this problem. 434 × 310 What are the partial products Marta will need to find the product? A. 4,340 and 130,2
Three states of a substance essential for life on Earth
what is the area of a square with sides 12 in. long? 1ft long?
how many 100-yards in a mile?
Which part of the earth system contains continents?
In which sentence does the hyphen correctly divide a word? A. The left ventricle is the fourth chamb- er of the heart. B. The left ventricle is the fourth cham-