 Welcome to this course on data structures and algorithms. In this session, we will take our discussions on queues further. We have another example to illustrate the use of queues. This example refers to what we call a Mumbai Vada Pav restaurant. Vada Pav by the way is a popular dish in western India. And of course, this restaurant like all other restaurants says not just Vada Pav, but many other items. Let us begin with an overview of the restaurant. The restaurant has fixed food items in the menu and there is one counter in which customers queue up to place orders. We assume that each customer can place order for at most 10 items and each customer must specify the quantity to be purchased for that item. Next, let us look at the behavior of the customer. Every customer arrives and stands in a queue, places order on his or her turn, gets a token ID and the cost to be paid. Pays that cost, collects the token ID and waits at a different table to collect the order when it is ready. We will need some data structures to represent various entities. So, we know that the restaurant maintains information about complete details of the menu. Menu has multiple items. So, we will assume that we have a food ID. We have the name of the food item like samosa. We have rate per item like 15.0 rupees. We will use structure food info to maintain this information. So, this is an example of typical data in the structure food info. You have food ID, you have food name, rate, etcetera. Now, we will have to use queues. The first queue, which is very obvious, is a queue for customers. As we already observed, a customer comes in a queue and when his or her turn comes, places order by giving multiple food IDs and quantities. Then, at the end, gets the token ID and cost to be paid. So, at the end of this queue, customer has got a token ID and presumably he has paid the cost. Next, we will presume that the person at the counter passes on that order to the kitchen and kitchen prepares that item or that order and sends it for another queue, which we call order dispatch queue. In this order dispatch queue, we will simply have token ID, which implies that once an order comes in the order dispatch queue, that particular token ID order is ready to be collected by the customer. As I mentioned, kitchen itself will have to store information about orders. So, we assume the following. We assume that each order placed by a customer is sent to kitchen. Now, what is the pertinent information for us at this juncture? The pertinent information is that token ID and time required for preparation of that order. Of course, there will be many more details, but we will ignore those at the moment. We presume that kitchen will prepare the ordered items, different time will be needed to prepare an order and the orders may not be prepared necessarily in the sequence of their arrival. So, as I mentioned, for now we use a simple array to represent kitchen operations. Each element of the array has token ID and time for preparation, which again will arbitrarily assign in this demonstration. We store every element of order queue in this array as order is placed. So, at the end, data structure in the kitchen array will have all orders that have been placed. For now, we will allocate an arbitrary time for order preparation for every order. Again, as I mentioned last time, in real life when we are simulating a true restaurant, we will have to generate a random number for the order preparation time based on various parameters like the items ordered, etcetera. Let us demonstrate this entire process. So, here is the person from the restaurant standing here waiting for customers. The customers come one by one. Let us assume that there are four customers who have joined this queue. The first customer is placing the order. When the order is placed, the customer will specify food ID and quantity. He gets, let us say, token number 1001 and cost is, let us say, 165. Order is placed. Now, preparation is started in kitchen because the order is sent immediately to that array for kitchen which stores all the orders. This customer comes and waits at this table waiting for the order to be disbanded. The next customer saying thing happens. Note that the second customer has a smaller order cost, but there are many items to be prepared. Obviously, this may take much longer to prepare than other orders. Here is a third customer. He has only one food item. Here is a fourth customer. He has only one food item. At the end, all four people have collected their coupons. Their orders have been placed and they are waiting at the table. As we notice, all items are being prepared in the kitchen. Now, this is the place where in our demonstration, we shall assume some arbitrary time for order preparation according to which the orders will be dispatched. Let us look at the kitchen order dispatch queue. Let us assume that the first order to be prepared is 1001. That comes in the kitchen dispatch queue and this person who is standing for with token number T1001 is happy to receive this order. Let us assume that the second order which comes in the queue is 1003. We have already indicated that different orders may take different preparation time. So, this time it is T1003 who gets the order fulfilled. Next comes, let us say T1002 and this customer now gets his order. Last is T1004. In short, we notice that the orders may be placed in a certain sequence such as token number 1001, 2345, etcetera, but the kitchen dispatch will depend upon the time required for preparation of each order. Once again, we have taken all images from open clipper. They are all in public domain. So, you can feel free to use this. This session to conclude has indicated the organization of a typical restaurant where customers queue up to place orders and then wait for their orders to be fulfilled. We have demonstrated that we can do that using two queues. The first queue is the customer queue and the next queue is the order dispatch queue. Again, in this illustration, we will assume arbitrary times for completing the order preparation and we have used arbitrary item codes and costs. Frankly, the item codes and costs are not relevant in this demonstration because we are concentrating on use of queues. In the next session, we will see how a simple C++ program can implement this Vada Power restaurant operations of our example. Thank you.