Assume that you are an employee in a Pizza Bakery and are given a list of ingredients that can be used in a pizza along with a list of their costs and sell prices. The index of an ingredient in the ingredient list is the same as its cost index in the costs list and its price index in the price list. The inputs look like this: Ingredients = {Cheese, Tomato, Basil, Green Pepper, Salami, Ham, Bacon, Olive} Costs = {2 , 1 , 1 , 1.5 , 3 , 4 , 8, 1} Price = {3 , 2 , 0, 0.5 , 1 , 7 , 7 , 1.5} We can say that Cheese costs $2 and if a pizza contains cheese we charge an additional 3$. Unfortunately, your manager is kind of an annoying person and puts a rule which as follows: If a customer asks for ingredient index x and ingredient index y where x < y, the customer must add the other ingredients between index x and y. For example, if a customer asks for Basil and Ham, the customer must also buy Green Pepper and Salami. The manager tells you to write a program that finds the sequence of ingredients that has the maximum revenue for the bakery. (You do not need to write the program) Demonstrate five steps of Dynamic programming for such a program. Give asymptotic complexity of the program.
Assume that you are an employee in a Pizza Bakery and are given a list of ingredients that can be used in a pizza along with a list of their costs and sell prices. The index of an ingredient in the ingredient list is the same as its cost index in the costs list and its price index in the price list. The inputs look like this:
Ingredients = {Cheese, Tomato, Basil, Green Pepper, Salami, Ham, Bacon, Olive}
Costs = {2 , 1 , 1 , 1.5 , 3 , 4 , 8, 1}
Price = {3 , 2 , 0, 0.5 , 1 , 7 , 7 , 1.5}
We can say that Cheese costs $2 and if a pizza contains cheese we charge an additional 3$.
Unfortunately, your manager is kind of an annoying person and puts a rule which as follows:
If a customer asks for ingredient index x and ingredient index y where x < y, the customer must add the other ingredients between index x and y.
For example, if a customer asks for Basil and Ham, the customer must also buy Green Pepper and Salami.
The manager tells you to write a program that finds the sequence of ingredients that has the maximum revenue for the bakery. (You do not need to write the program)
Demonstrate five steps of Dynamic programming for such a program.
Give asymptotic complexity of the program.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 3 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Advanced Engineering Mathematics](https://www.bartleby.com/isbn_cover_images/9780470458365/9780470458365_smallCoverImage.gif)
![Numerical Methods for Engineers](https://www.bartleby.com/isbn_cover_images/9780073397924/9780073397924_smallCoverImage.gif)
![Introductory Mathematics for Engineering Applicat…](https://www.bartleby.com/isbn_cover_images/9781118141809/9781118141809_smallCoverImage.gif)
![Advanced Engineering Mathematics](https://www.bartleby.com/isbn_cover_images/9780470458365/9780470458365_smallCoverImage.gif)
![Numerical Methods for Engineers](https://www.bartleby.com/isbn_cover_images/9780073397924/9780073397924_smallCoverImage.gif)
![Introductory Mathematics for Engineering Applicat…](https://www.bartleby.com/isbn_cover_images/9781118141809/9781118141809_smallCoverImage.gif)
![Mathematics For Machine Technology](https://www.bartleby.com/isbn_cover_images/9781337798310/9781337798310_smallCoverImage.jpg)
![Basic Technical Mathematics](https://www.bartleby.com/isbn_cover_images/9780134437705/9780134437705_smallCoverImage.gif)
![Topology](https://www.bartleby.com/isbn_cover_images/9780134689517/9780134689517_smallCoverImage.gif)