Data Structures and Algorithms

Slides:



Advertisements
Similar presentations
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Advertisements

Copyright © Fourgen Information System (Pvt,) Ltd. All rights reserved.
DFD Examples Yong Choi BPA CSUB.
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
DT211 Stage 2 Software Engineering
Two-week ISTE workshop on Effective teaching/learning of computer programming Dr Deepak B Phatak Subrao Nilekani Chair Professor Department of CSE, Kanwal.
Applications of Data-Structure
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
NETW 707 Modeling and Simulation Amr El Mougy Maggie Mashaly.
Computer Science Department Data Structures and Algorithms Queues Lecture 5.
Accounting Information Systems: A Business Process Approach Chapter Three: Documenting Accounting Systems.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
An algorithm for triangulating multiple 3D polygons M Zou, T Ju, N Carr Eurographics Symposium on Geometry Processing 2013 Who? Kundan Krishna 1 From?
IIT Bombay Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty Department of Computer Science and Engineering IIT Bombay Session: Operator.
IIT Bombay Data Structures and Algorithms Prof. Ajit A. Diwan Prof. Ganesh Ramakrishnan Prof. Deepak B. Phatak Department of Computer Science and Engineering.
IIT Bombay Data Structures and Algorithms Prof. Ajit A. Diwan Prof. Ganesh Ramakrishnan Prof. Deepak B. Phatak Department of Computer Science and Engineering.
IIT Bombay Data Structures and Algorithms Prof. Ajit A. Diwan Prof. Ganesh Ramakrishnan Prof. Deepak B. Phatak Department of Computer Science and Engineering.
IIT Bombay Data Structures and Algorithms Prof. Ajit A. Diwan Prof. Ganesh Ramakrishnan Prof. Deepak B. Phatak Department of Computer Science and Engineering.
IIT Bombay Data Structures and Algorithms Prof. Ajit A. Diwan Prof. Ganesh Ramakrishnan Prof. Deepak B. Phatak Department of Computer Science and Engineering.
Data Structures and Algorithms
DFD Examples Yong Choi BPA CSUB.
Data Structures and Algorithms
Data Structures and Algorithms
Data Structures and Algorithms
Data Structures and Algorithms
Data Structures and Algorithms
Review Array Array Elements Accessing array elements
Class Relationships in C++
UML Diagrams: Class Diagrams The Static Analysis Model
Queue ADT (Abstract Data Type) N …
Outline lecture Revise arrays Entering into an array
Course Developer/Writer: A. J. Ikuomola
Chapter 11 Heap.
Data Structures and Algorithms
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty
Data Structures and Algorithms
Process Description and Control
Stacks and Queues.
Queues Queues Queues.
Data Structures and Algorithms
Data Structures and Algorithms
Data Structures and Algorithms
Start Your Restaurant Online Ordering System Similar To Online Food Ordering Websites
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty
Atom-Based Embedded System Design at CUHK
System Structure B. Ramamurthy.
Arrays and Linked Lists
System Structure and Process Model
Team # 13 Touch 2 Order.
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty
CSE 214 – Computer Science II B-Trees
Introduction To Programming Information Technology , 1’st Semester
Process Description and Control
Cs212: Data Structures Computer Science Department Lecture 7: Queues.
Chapter 2 Control Structures.
By Yogesh Neopaney Assistant Professor Department of Computer Science
DFD Examples Yong Choi BPA CSUB.
DFD Examples Yong Choi BPA CSUB.
Engine Part ID Part 1.
Introduction to data structures
Engine Part ID Part 2.
Engine Part ID Part 2.
DFD Examples Yong Choi BPA CSUB.
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty
Accounting Information Systems: A Business Process Approach
B207A Big ideas in organizations
Introduction to data structures
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty
COS 151 Bootcamp – Week 4 Department of Computer Science
Computer Programming Dr. Deepak B Phatak Dr. Supratik Chakraborty
Presentation transcript:

Data Structures and Algorithms Prof. Ajit A. Diwan Prof. Ganesh Ramakrishnan Prof. Deepak B. Phatak Department of Computer Science and Engineering IIT Bombay Session: Mumbai Vada-Pav Restaurant Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Mumbai Vada-Pav Restaurant: Overview This restaurant has Fixed food items in the menu One counter (queue) for customer to place order Every customer can place order for Maximum 10 items Quantity must be specified for each item Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Customer Arrives and stands in a queue Places order on his/her turn Gets a Token ID and cost to be paid Waits at a table to collect the order when it is ready Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Data Structures Restaurant maintains information of each item in the menu Food ID (e.g. 1) Food Name (e.g. Samosa) Rate per item (e.g. Rs. 15.0) We will use structure ‘foodInfo’ to maintain this information Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Data Structures Structure: foodInfo Food ID Food Name Rate 1 Vada Pav 10.0 2 Uttappa 18.0 3 Samosa 15.0 … 12 Shira 26.0 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Data Structures using Queues Use queues to facilitate the process Queue 1: Customer Queue Places order by giving (multiple) Food ID and Quantity Gets Token ID Cost to be paid Queue 2: Order Dispatch Queue Token ID (The order is ready to be collected by the customer) Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Data Structure for the kitchen Each order placed by a customer is sent to kitchen Kitchen will prepare the ordered items different time needed to prepare an order Orders may not be prepared in their arrival sequence For now, we use a simple array to represent kitchen operations Each element of the array will have Token-id Time for preparation We will store every element of order queue in this array For now, we will allocate an arbitrary time for order preparation Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Let us demonstrate the entire process Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration CustomerOrder Queue Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration CustomerOrder Queue Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration CustomerOrder Queue Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration CustomerOrder Queue Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration CustomerOrder Queue Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Order placed Token: 1001 Preparation started in kitchen foodID Qty 3 1 7 5 Token: 1001 Cost: 165 CustomerOrder Queue Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Order placed Token: 1002 Preparation started in the kitchen foodID Qty 1 3 9 2 12 1 Token: 1002 Total Cost: 100 CustomerOrder Queue T 1001 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Order placed Token: 1003 Preparation started in the kitchen foodID Qty 11 1 Token: 1003 Total Cost: 19 CustomerOrder Queue T 1002 T 1001 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Order placed Token: 1004 Preparation started in the kitchen foodID Qty 5 2 Token: 1004 Total Cost: 40 CustomerOrder Queue T 1002 T 1001 T 1003 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Items are being prepared in the kitchen CustomerOrder Queue T 1004 T 1002 T 1001 T 1003 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Kitchen OrderDispatch Queue CustomerOrder Queue 1001 T 1004 T 1002 T 1001 T 1003 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Kitchen OrderDispatch Queue CustomerOrder Queue 1003 1001 CustomerOrder Queue T 1004 T 1002 T 1001 T 1003 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Kitchen OrderDispatch Queue CustomerOrder Queue 1003 1002 1003 1001 CustomerOrder Queue T 1004 T 1002 T 1001 T 1003 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Demonstration Kitchen OrderDispatch Queue CustomerOrder Queue 1004 1002 1003 1001 CustomerOrder Queue T 1004 T 1002 T 1001 T 1003 Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

References All images are taken from https://openclipart.org Which are released in public domain Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay

Thank you Ajit A. Diwan, Ganesh Ramakrishnan, and Deepak B. Phatak, IIT Bombay