A C++ implementation of a flight reservation system using two data structure approaches: Array-based and Linked List-based, with performance comparison between both.
Modern airlines depend on efficient digital systems to manage passenger bookings, seat allocation, and flight manifests. This project simulates a Flight Reservation & Seating Management Component that handles:
- Seat reservations and cancellations
- Passenger lookup by ID
- Full seating chart and manifest display
- Performance comparison between static (array) and dynamic (linked list) data structures
- 2D array for seat assignment grid
- 1D array for passenger records
- Index-based fast seat access
- Sorting and filtering by row or class
- Singly/Doubly linked list for dynamic passenger records
- Node-based insertion, deletion, searching, and traversal
- Flexible memory allocation
| Function | Description |
|---|---|
| Reservation | Allocate an available seat to a new passenger |
| Cancellation | Remove a passenger by PassengerID and free the seat |
| Seat Lookup | Retrieve passenger details using PassengerID |
| Manifest & Seat Report | Display full seating chart and passenger list |
| Operation | Array | Linked List |
|---|---|---|
| Search | O(n) | O(n) |
| Insertion | O(1) (by index) | O(1) (at head/tail) |
| Deletion | O(n) | O(n) |
| Memory | Static allocation | Dynamic allocation |
flight_passenger_data.csv— Contains passenger booking records- Fields:
PassengerID,Name,SeatRow,SeatColumn,Class
- Fields:
- Language: C++
- No STL containers (
<vector>,<list>) — all data structures are custom-built
# Compile
g++ -o main main.cpp
# Run
./mainMake sure flight_passenger_data.csv is in the same directory as the executable.
| Member | Role |
|---|---|
| Chan Xin Quan | Seat Report |
| Chen Zheng Hao | Cancel Seat (Deletion) |
| Kaemon Ng | Reserve Seat (Insertion) |
| Sawraw Madub | Search Seat |
cpp-flight-system-data-structure-full-version-v1/
├── array.cpp # Array-based reservation implementation
├── array.hpp # Array class header
├── linked_list.cpp # Linked list-based reservation implementation
├── linked_list.hpp # Linked list class header
├── passenger.cpp # Passenger data model implementation
├── passenger.hpp # Passenger class header
├── main.cpp # Driver program
└── flight_passenger_data.csv # Dataset