This program takes an input file containing customer's requests for reserving seats in a movie theater and processes these requests to maximise customer satisfaction and customer safety . This program also takes public safety into account by keeping a buffer of 3 seats and/or a row between two groups of customers. Customer satisfaction is achieved by assigning customers the last available rows and not splitting the groups.
- A good metric for customer satisfaction is that all groups of customers want to be seated as far away from the screen as possible.
- The rows furthest from the screen give the most customer satisfaction, and it decreases as the seats assigned are closer to the screen.
- A group of people who are booking the tickets want to be seated together, they won't be split.
- Since a group is seated together, there is a limit of 20 tickets per booking, this also helps in handling misuse of tickets.
- The reservation requests that arrive first should be handled first. (First Come First Serve)
The algorithm takes a Greedy approach by starting the seat assigning process from the first available seat in the farthest row possible and then moving forward.
All the operations are linear in terms of the array, but since only 200 seats are there, it is O(1) time and O(1) space.
- Customers should be able cancel/change their seats.
- Fitting in as many customers as possible by splitting groups of people when consecutive seats are unavailable.
Step 1 -> Create Executable File g++ -std=c++20 -o main main.cpp
Step 2 -> Run Executable ./main </path/to/file>
Step 1 -> Create Test Executable File g++ -std=c++20 -o test TestsDriver.cpp
Step 2 -> Run Executable ./test