1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vitfil [10]
3 years ago
5

Consider the following Stack operations:

Computers and Technology
1 answer:
maxonik [38]3 years ago
6 0

Answer:

Sequence of popped values: h,s,f.

State of stack (from top to bottom): m, d

Explanation:

Assuming that stack is  initially empty. Suppose that p contains the popped values. The state of the stack is where the top and bottom are pointing to in the stack. The top of the stack is that end of the stack where the new value is entered and existing values is removed. The sequence works as following:

push(d) -> enters d to the Stack

Stack:  

d ->top

push(h) -> enters h to the Stack

Stack:

h ->top

d ->bottom

pop() -> removes h from the Stack:

Stack:

d ->top

p: Suppose p contains popped values so first popped value entered to p is h

p = h

push(f) -> enters f to the Stack

Stack:

f ->top

d ->bottom

push(s) -> enters s to the Stack

Stack:

s ->top

f

d ->bottom

pop() -> removes s from the Stack:

Stack:

f ->top

d -> bottom

p = h, s

pop() -> removes f from the Stack:

Stack:

d ->top

p = h, s, f

push(m) -> enters m to the Stack:

Stack:

m ->top

d ->bottom

So looking at p the sequence of popped values is:

h, s, f

the final state of the stack:

m, d

end that is the top of the stack:

m

You might be interested in
How many iphones have Apple sold in 2019?
Phoenix [80]

Answer:

40.7 million iphones

Explanation:

Gupta. Apple's iPhone sales continued to decline in the third quarter of 2019. Apple sold 40.8 million iPhones, a year-over-year decline of 10.7%.

3 0
3 years ago
Read 2 more answers
Does anyone know who this man issss?
devlian [24]

Kaeya Should be the correct answer

3 0
3 years ago
Todd, a manager at Dexter Manufacturing, has received a grievance filed by a group of his subordinates who are union members. Wh
romanna [79]

Answer:

B. The employees contact the labor union arbitrator, who then sends an e-mail to Todd.

Explanation

Todd, 5he manager has just received a grievance filed by his subordinates who are union members because of a dispute.

A grievance can be filed when there is dissatisfaction at work, or anger at policy or something else that is a work related grievance.

The likeliest scenario for escalating their dissatisfaction to their employee would be to present their grievance through their union arbitrator who is charged with protecting the work interests of its union members.

This is necessary because the employer knows the anger of the employees and dialogue can take place.

7 0
3 years ago
To plan a pizza party, one may want to order enough pizza for everyone. Use the slicesInPizza, slicesPerPerson, and totalGuests
zheka24 [161]

Answer:

Explanation:

The following code was written in Javascript. It asks the user to enter the values for each of the variables and saves it to them. Then it uses those values to calculate the total number of pizzas needed to feed everyone at the party. Finally, it prints out the total to the screen as an alert. Both test cases were used and the outputs can be seen in the attached images below.

var slicesPerPizza = window.prompt("How many slices per pizza?");

var slicesPerPerson = window.prompt("How many slices per person?");

var totalPersons = window.prompt("How many total people will attend?");

var pizzasNeeded = Math.round((slicesPerPerson * totalPersons) / slicesPerPizza)

alert(`You need a total of ${pizzasNeeded} pizzas.`)

6 0
3 years ago
I Need Help With This I'm Just At Home Working And I Am Kinda Stuck On This Question Please Help
kvasek [131]

Answer:

move forward 300 pixels and turn right by 15 pixels

repeat then turn left instead of right

do this either 5 or 10 times idk which one

Explanation:

6 0
3 years ago
Other questions:
  • the task is to ask the user for three numbers and find the average which pseudocode gives you the comment outline for task​
    10·1 answer
  • The cost of large ground based telescopes has remained the same since the 1800's costing the equivalent of about a billion dolla
    9·1 answer
  • Henry is designing a document for his architecture project. In which order should Henry preform the different tasks that are req
    7·1 answer
  • 2. Create a file with the follow integer/string content and save it as fun.txt. 6 fun. 3 hello 10 <> 2 25 4 wow! Write an
    14·1 answer
  • Provides images of weather systems, and helps to track storms at different altitudes
    7·1 answer
  • Hi whats airpods good for
    15·2 answers
  • A software EULA is an agreement related to which of the following?
    11·2 answers
  • Write a method that takes a Regular Polygon as a parameter, sets its number of sides to a random integer between 10 and 20 inclu
    10·1 answer
  • Recent trends on operating system
    7·1 answer
  • Cora is writing a program to make a motorcycle racing game. If Cora wants the speed of the motorcycle to appear on the screen wh
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!