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

Why was Ruby Bridges respectful?
In a sale, a clothes shop reduces its prices by 40% a shirt usually costs £22 how much is it in the sale x
Solve equation (4r-2)-(3r+1)=8
A realtor makes a commission of $11,400 on a $190,000 house he sells. What is his commission rate?
Which of these describes the Apollo 11 flight plan as a historical document? historical interpretation personal narrative primary source document secondary sour
Is women and men raised for toughness a characteristic of Athens, Sparta, or both? A. Athens B. Sparta C. Athens and Sparta.
Which of the following represents a difference between the government of the Roman Republic and that of Imperial Rome?
what are some props i could do for clara barton plz help
What is $9 ; 10 percent increase
what would happen to temperatures on earth the suns heat were distributed throughout the atmosphere