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

The Japanese government promotes in the industrialisation which statement best completes the diagram
Trivia Time!! At what velocity does light move?
How were citizens of Rome involved in the political process? O Roman citizens had no input on ancient Rome's political process but were involved in electing pub
In parallelogram MNPQ if m/PQM = 140° find m/MNP.
Find the measure of each missing angle.
Can someone help me with this?
Review how adjectives change to Match the nouns they modify. Then choose the correct form or the adjective for these nouns (In Spanish)
What is the a-value of the graph? ​
HELP FAST! Which of the following volume measurements is the best estimate for the figure above? Round each measurement to the nearest whole number to get your
3x + 2(x − 1) − 4? pleeeessssssssssssssssssssssssssss