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
A(n) ______ is a laptop computer that can convert into a tablet-like device.
Ira Lisetskai [31]
(ignore the words in parenthesis, I just have to have 20 letters in an answer) 2-in-1 PC
4 0
3 years ago
Which of the following is not true about managing your privacy settings? (select all that apply)
Evgesh-ka [11]
I'm going with 
<span>The things that you post online become public information.
and
</span><span>Employers screen job candidates based on social medias.

Because when you post online, you can very easily make your account private, or only share the post to a specified group of people.

Employers also screen job candidates based on their backround, personality, etc.</span>
4 0
4 years ago
Read 2 more answers
Write a program that asks the user to enter two numbers,obtains the two numbers from the user and prints the sum,product,
Andru [333]

Answer:

#include<iostream>

using namespace std;

//main function

int main(){

   //initialization

   float a1,a2;

//display the message

cout<<"Enter the first number: ";

   cin>>a1;  //store the value

   cout<<"Enter the second number: ";

   cin>>a2;   //store the value

   //display the calculation result

   cout<<"The sum is: "<<a1+a2<<endl;

   cout<<"The Subtraction is: "<<a1-a2<<endl;

   cout<<"The product is: "<<a1*a2<<endl;

   cout<<"The Quotient is: "<<a1/a2<<endl;

}

Explanation:

Create the main function and declare the two variables of float but we can enter the integer as well.

display the message on the screen and then store the input enter by the user into the variable using the cin instruction.

the same process for second input as well, display the message and store the input.

after that, print the output of the calculation. the operator '+' is used to add the two numbers like a1+a2, it adds the number stored in the variable.

similarly, the subtraction operator is '-', product '*' and quotient operator '/'.

and finally, we get the desired output.

4 0
3 years ago
scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU
dexar [7]

SJF scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU bursts.

<h3>What is SJF in operating system?</h3>

SJF is a term that connote Shortest Job First. It is said to be a type of CPU scheduling whose algorithm is linked with each as it is said to process the length of the next CPU burst.

Note that for one to be able to know the time for the next CPU burst to take place, one need to take the SJF into consideration as that is its function.

Hence, SJF scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU bursts.

See options below

A) Multilevel queue

B) RR

C) FCFS

D) SJF

Learn more about scheduling from

brainly.com/question/19309520

#SPJ1

3 0
2 years ago
Which browser do most web users use and why do you think that it is that way? Make sure you search online for statistics to conf
oksian1 [2.3K]

Answer:

2b2t

Explanation:

2b2t

4 0
4 years ago
Other questions:
  • in c++, what happends when i add 1 to the RAND_MAX then take rand() deivded by (RAND_MAX+1)?if my purpose is to take out a rando
    11·1 answer
  • For a wire with a circular cross section and a diameter = 3.00mm calculate the following: (m means meter. mm means millimeter. c
    5·1 answer
  • Employees at the Red Bluff Golf Club &amp; Pro Shop have the opportunity to become certified trainers if they log enough hours.
    13·1 answer
  • Distributed computing is a term that describes the work that autonomous computers can do to achieve a common goal, especially in
    10·1 answer
  • Write a method intersect that accepts two sorted array lists of integers as parameters and returns a new list that contains only
    8·1 answer
  • Which of these is not an application software?
    6·2 answers
  • Several programmers write individual code modules that are used for different processes in a vehicle. Individual tests have alre
    13·1 answer
  • SummaryIn this lab, you complete a partially prewritten Java program that uses an array.The program prompts the user to interact
    12·1 answer
  • Alfred works in the human resources department, and he uses a management information system to find applicants' résumés on the w
    7·1 answer
  • Which of the follow efficiencies would be considered unreasonable?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!