Question: Once upon the time, there was one restaurant with only one boss, one chef, and one wok. The restaurant Uji Jin Hall is famous for

Once upon the time, there was one restaurant with only one boss, one chef, and one wok. The restaurant
Uji Jin Hall is famous for its variety of delicious fried rice dishes. After cooking each dish, the chef
must wash the wok. During the busy noon hours, the restaurant owner wants to increase throughput by
reducing the wok washing time. The owner suggests that the chef can skip washing the wok if cooking
the same type of fried rice consecutively.
To maintain the restaurants reputation and customer satisfaction, orders must be fulfilled in the order
they were placed. However, the chef can skip some orders to maximize efficiency.
There are T minutes available at noon. Assume that cooking any dish takes A minutes and washing
the wok takes B minutes. Given a sequence of N orders in chronological order (all the orders are placed
before noon), how many dishes can the restaurant serve within the available time? Devise an algorithm
to solve this problem. Give a correctness proof and analyze the running time.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!