subject
Mathematics, 31.07.2019 19:30 haleydanielle8

In this problem we consider two stacks a and b manipulated using the following operations (n denotes the size of a and m the size of b):
• pusha(x): push element x on stack a.
• pushb(x): push element x on stack b.
• multipopa(k): pop min{k, n} elements from a.
• multipopb(k): pop min{k, m} elements from b.
• transfer(k): repeatedly pop an element from a and push it on b, until either k elements have been moved or a is empty.
assume that a and b are implemented using doubly-linked lists such that pusha and pushb, as well as a single pop from a or b, can be performed in o(1) time worst-case.
(a) what is the worst-case running time of the operations multipopa, multipopb and transfer?
(b) define a potential function φ(n, m) and use it to prove that the operations have amortized running time o(1).

ansver
Answers: 3

Another question on Mathematics

question
Mathematics, 21.06.2019 15:30
It takes a total of 6 hours to fill up an inground backyard pool using a standard house. a function can represent this situation to represent the amount of water in the pool until it is full a function of time the hose is running. determine the domain for the function
Answers: 1
question
Mathematics, 21.06.2019 18:30
What is the area of the triangle 10 13 12
Answers: 1
question
Mathematics, 21.06.2019 19:00
The graph shows the charges for a health club in a month. make a function table for the input-output values. writes an equation that can be used to find the total charge y for the number of x classes
Answers: 2
question
Mathematics, 21.06.2019 19:00
X+ y = 5 ; x - y =3 solve using linear combination
Answers: 2
You know the right answer?
In this problem we consider two stacks a and b manipulated using the following operations (n denotes...
Questions
question
Mathematics, 03.11.2020 23:30
question
Physics, 03.11.2020 23:30
question
Mathematics, 03.11.2020 23:30
Questions on the website: 13722362