0% found this document useful (0 votes)
64 views2 pages

Project 1

The document describes a bus booking system project that uses a binary search tree data structure. The project involves creating data structures to store information about buses, customers, and bookings. The bus information is stored in a binary search tree using the bus code as the key. Customer and booking information are stored in linked lists. The program displays a menu with options to load and manipulate data, including options to insert, search, delete and traverse the binary search tree and linked lists. The tasks are to be implemented from scratch without using built-in Java data structures. The submission requirements include source code files, test files, and a run batch file compressed into a zip folder named with the student's details.

Uploaded by

khoa20033002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views2 pages

Project 1

The document describes a bus booking system project that uses a binary search tree data structure. The project involves creating data structures to store information about buses, customers, and bookings. The bus information is stored in a binary search tree using the bus code as the key. Customer and booking information are stored in linked lists. The program displays a menu with options to load and manipulate data, including options to insert, search, delete and traverse the binary search tree and linked lists. The tasks are to be implemented from scratch without using built-in Java data structures. The submission requirements include source code files, test files, and a run batch file compressed into a zip folder named with the student's details.

Uploaded by

khoa20033002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

DSA – Project 1

Bus Booking System


using Binary Search Tree data structure
INTRODUCTION

Your second assignment in this block will be using Binary Search Tree data
struture for implementing a Bus Booking System (BBS) in Java language.
BBS manages information about Buses, customers and bus booking. These
information are:
About a bus:
1. bcode (string): the code of the bus (this variable is the key of the tree, thus it should
be unique for the bus).
2. bus_name (string): the name of the bus.
3. seat (integer): the number of seats in the bus (seat > 0).
4. booked (integer): the number of booked seats in the bus (booked >= 0 and booked ≤
seat).
5. depart_time (double): The depature time of the bus (depart_time >= 0).
6. arrival_time (double): The arrival time of the bus (arrival_time > depart_time).

About a customer:
1. ccode (string): the code of the customer (this variable should be unique for the customer).
2. cus_name (string): the name of the customer.
3. phone (string): The phone number of the customer (must contain digits only).

About Booking:
1. bcode (string): the code of the bus to be booked.
2. ccode (string): the code of the customer.
3. seat (integer): the number of seats to be booked on the bus.

YOUR TASKS
You should use 1 binary search tree to store data for buses and 2 linked lists, each one
is used to store data for customers or booking items. You should create the data
structures from scratch, do not use structures available in java.

On running, your program displays the menu as below:

Products (8 marks) (using Binary Search Tree data structure, where bcode is the key
of the tree):
1.1. Load data from file
1.2. Input & insert data
1.3. In-order traverse
1.4. Breadth-first traverse
1.5. In-order traverse to file
1.6. Search by pcode
1.7. Delete by pcode by copying
1.8. Simply balancing
1.9. Count number of buses

Customer list (1 mark):


2.1. Load data from file
2.2. Input & add to the end
2.3. Display data
2.4. Save customer list to file
2.5. Search by ccode
2.6. Delete by ccode

Booking list (1 mark):


3.1. Input data
3.2. Display booking data
3.3. Sort by pcode + ccode

Submission Requirements
Create the directory with a name like <class>-<name><roll number>-AS2, e.g.
SE0508-QuangTV00456-AS2 (1)
The (1) directory contains the following files:

1. The run.bat file to run your program.


2. Your source code files.
3. Your input test files (bus.txt and customer.txt).

The statements in run.bat file may be:


cls
javac Main.java
java Main
pause
del *.class

Compress the folder (1) to .zip (or .rar) file (with the same name) and upload to cms.

Assignment assessment
You will be asked to modify immediately and to explain your assignment in lab room
to be sure that you are really the author of the assignment you submitted.

You might also like