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
Elina [12.6K]
3 years ago
13

. Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push

(30) s.push (40) s.pop () s.pop () s.push (50) s.push (60) s.push (70) s.pop () s.pop () s.push (80) s.push (90) s.pop ()
a) Write out the composition of the stack after these operations. b) What sequences of integers was popped off the stack?
Computers and Technology
1 answer:
sp2606 [1]3 years ago
4 0

Answer:

a) The composition of the stack is :- 80,50,20,10.

Where 80 is the top and 10 is the last element.

b) The sequence of the popped items 40,30,70,60,90.

Explanation:

Stack is LIFO type data structure means Last in First Out.The element inserted last will be out of the stack first.The removal and addition is only at the one end that is top.

First 10,20,30,40 will be inserted in the stack. 40 is a the top.Now two pop operations occurs. 40 and 30 will be removed from the stack.

Now 50,60,70 will be inserted in the stack then again two pop operations so 70 and 60 will be removed from the stack.

Now the stack contains 50,20,10.Top = 50.

80 and 90 are added to the stack and 1 pop operation that is 90 will be removed.

Stack is 80,50,20,10 . Top = 80.

Sequence of integers popped=40,30,70,60,90.

You might be interested in
What is the reason for taking care of design a good computer human interface ​
anygoal [31]

Answer:

computer is one of the part of our technology so that let's take care of it and improve so that we can used for better and sufficient ly not maybe now but maybe soon.

3 0
3 years ago
Read 2 more answers
Joe always misspells the word calendar. He types the word as calender but the correct spelling appears on the document. Which fe
Anika [276]
A. Autocorrect is the answer
7 0
3 years ago
You have spent $4,000 on liquor for your bar. Your bar sales have been $24,000. What is your cost of sales for liquor, expressed
amid [387]

Answer:

17%

Explanation:

Given parameters:

Cost price of liquor = $4000

Total sale = $24000

Unknown:

Percentage cost of sale for liquor = ?

Solution:

To find the percentage cost of sale;

       %Cost of sale of liquor = \frac{cost price of liquor}{Total cost of sale }   x 100

Input the variables;

       %Cost of sale of liquor = \frac{4000}{24000}  x 100 = 16.67% = 17%

8 0
3 years ago
Variables defined inside a member function of a class have: Block scope. Class or block scope, depending on whether the binary s
Snowcat [4.5K]

Answer:

The answer is "Block scope".

Explanation:

In the programming, the scope is a code, in which it provides the variable ability to exist and not be retrieved beyond variable. In this, the variables could be defined in 3 locations, that can be described as follows:

  • Inside a method or the block, which is also known as a local variable.
  • Outside of the method scope, which is also known as a global variable.
  • Defining parameters for functions known as formal parameters.
8 0
3 years ago
I need help ASAP please and thank you!
hram777 [196]

Answer:

B) Sees failure as a way to get better.

Explanation:

Someone with a growth mindset sees failure as a way to get better. A growth mindset is one that typically do not see failure as a stunning block but rather as a way to get better and excel.

7 0
3 years ago
Other questions:
  • You have found statistics on the Internet that you would like to use in your speech.
    6·1 answer
  • When using a wireless mouse, what is the most common port used for the transmitter? 
    7·1 answer
  • What tool is provided in Windows to facilitate sharing data objects between applications and computers?
    8·1 answer
  • If all the data in a database is not physically located in one place, it would be a(n _______ database.
    5·1 answer
  • Which list shows a correct order of mathematical operations that would be used by a spreadsheet formula?
    5·2 answers
  • Please Help meeeeeeeeeee:
    11·2 answers
  • Create an application that determines the final cost of food items and non-food items, assuming only non-food items are taxed. T
    8·1 answer
  • Draw
    7·1 answer
  • Physical education is the body's ability to function effectively and efficiently without excessive farigue. TRUE/FALSE
    15·1 answer
  • What kind of energy transformation occurs when you call someone on a cell phone?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!