Assignment 1
Data Structure and Algorithm
Fall 2024
Total Marks: 100
Submission Date: 7 December 2024
Submission Instructions: Upload the folder link (with your ID as its file name) on google classroom.
Single Linked List
There is a ticket reservation system in C++ using single linked list. Where customer can reserve his / her seat
through reservation section. Here's a general outline:
Classes:
• Seat: Each node in the singly linked list represents a seat. It can store information like seat number, booking
status (available/booked), passenger details (name), and next nodes.
• Reservation List: This list holds all the seat nodes, allowing efficient traversal in both directions (useful for
displaying available seats, finding specific seats, etc.).
Functionalities:
• Book Ticket: This function takes the relevant information for the ticket reservation and booked the specified
seat.
• Cancel Ticket: This function takes seat number as an input and the delete corresponding seat.
• Display reserve Seats: This function traverses the list and prints the information of all reserve seats.
• Search for Seat: This function takes a seat number as input and finds its corresponding node in the
list, returning information like booking status or passenger name.
• Update Seat info: This function takes a seat number as input and finds its corresponding node in the
list, updating information like booking status or passenger name.
Best of Luck