# 数据结构代写 | COMP9024 20T2 Assignment

COMP9024 20T2 Assignment

Objectives
The assignment aims to give you more independent, self-directed practice with
graph algorithms
asymptotic runtime analysis
Schedules
Next, your program should ask the user for the number m of busses, trains and light rail vehicles running
during a day, followed by m schedules. Each schedule requires the number of stops, k≥2, followed by
k*2 lines of the form:
hhmm
stop-name
meaning that passengers can get on or off at that time (hh – hour, mm – minute) at that stop. An example
is:
Enter the number of schedules: 2
Enter the number of stops: 5
1640
UNSW
1645
Kensington
1705
Central
1708
Chinatown
1715
Wynyard
Enter the number of stops: 2
1645
UNSW
1700
Central
You may assume that:
The input is syntactically correct: 4 digits, then a new line with the name of a stop.
All times are valid and range from 0000 to 2359.
Stops are input in the right (temporal) order.
There are no overnight connections: Each bus, light rail or train will reach its final stop before
midnight.
Only valid stops that have been input before will be used.

Stage 1 (3 marks)
For stage 1, you should demonstrate that you can read the input and generate a suitable data structure.
For this stage, all test cases will only use queries (From, To, DepartAt) for which
there is only one bus, train or light rail service connecting From and To ; and
this is guaranteed to depart on, or after, the requested time, DepartAt .
Hence, all you need to do for this stage is find and output this direct connection, including all stops along
the way and the arrival/departure times. Here is an example to show the desired behaviour of your
program for a stage 1 test:
prompt\$ ./goNSW
Enter the total number of stops on the network: 7
Wynyard
QVB
Central
Kensington
UNSW
Glebe
Enter the number of schedules: 2
Enter the number of stops: 5
0945
Wynyard
0950
QVB
1000
Central
1022
Kensington
1027
UNSW
Enter the number of stops: 2
1459
1518
Glebe
To: Glebe
Depart at: 0950