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

Which is not a valid range? a1:a3, b1:b3 a1:a9 a1:f9 a1:f1?
Fiona has a job at a garage. She needs to prepare a paint mix to spray on a car. Fiona needs to blend colour with a hardener and a reducer in the ratio 8:1:1
What is the approximate value of sin C?
When using the indirect approach to deliver negative news, what does the message open with?
What dance form is performed to traditional music, prescribed movements, and traditional costume?
Please help! ASAP !!!!!!!!!
which if the following statements accurately describes the phases of the menstrual cycle in humans
The neuron and muscle fiber membranes do not actually touch but are separated by a fluid-filled gap
Is there a difference from the nucleus in the animal than the nucleus in the plant cell?
Please help if anyone knows!!!