19cse212-Railway
Consider the railway book ticket reservation for festival season. Assume that railway department receives the booking requests from the passengers before one month and then release final list of accepted booking requests with allocated seat number. Railway department gives highest preference to the passenger who are regularly travelling the destination. Hence once the passenger enters name with phone number/address, refers the number of times the passenger travelled to the specified destination in the past. Design and Implement solution for the given reservation scenario using heap ADT implement the following operations.
RR Phonenumber nt: Reservation request phonenumber with number of times travelled (nt)
F: Generate the Final list of passenger list
Input:
- The first line contains the heap size.
- second line reads the number of operations.
- Each line of the subsequent lines contains a reservation request phonenumber with number of times travelled (nt) in the form described in the problem statement above.
Output: The returned value from the operation will be printed by the main class. The formatting is as given in the sample output.
Sample Input:
10 3 RR 10 50 RR 16 70 F
Sample Output:
[10] [50] [16 , 10] [70 , 50] [16 , 10] [70 , 50]
Comments