” COMP9024编程 辅导、Data Structures程序 写作Data Structures and Algorithms COMP9024 20T3AssignmentTripPlannerObjectivesThe assignment aims to give you more independent, self-directed practicewith advanced data Structures, especially graphs graph algorithms asymptotic runtime analysis understanding How to use graphs to solve problems in real life.AimYour task is to write a program TripPlaner.c for finding an optimal busconnection that takes into account a given arrival time and user preferences.To implement the TripPlaner you will need to implement a simple busnetwork. For that you will use a digraph to represent a bus network andimplement several functions for the bus network to enable it usage.AdminMarks 3 marks for stage 1 (correctness)5 marks for stage 2 (correctness)2 marks for stage 3 (correctness)1 marks for complexity analysis1 mark for styleTotal: 12 marksDue 12:00 noon on Monday 23 NovemberLate 2 marks (16.67%) off the ceiling per day late(e.g. if you are 25 hours late, your maximum possiblemark is 8)Data Structures and Algorithms COMP9024 20T3The TripPlanerThe bus network will consists of a set of bus stops and the bus schedule. Each bus stop has a unique name that consists of one word, such asParramatta. Each bus has a schedule, given in hhmm meaning that passengers canget on or off the bus at that time (hh hour, mm minute) at particular busstop.InputBus Stop namesYour program should start by prompting the user to input a positive number nfollowed by n lines, each containing the name of a bus stop. An example Is:You may assume that: The input is syntactically correct. Bus stop names require no more than 31 characters and will not useany spaces. No bus stop name will be input more than once.Hint:To read a single line with a bus stop name you may use scanf.BusesNext, your program should ask the user for the number m of busses runningduring a day, followed by m schedules.Each schedule Requires the number of stops, k2, followed by k*2 lines of theform:Data Structures and Algorithms COMP9024 20T3If you enter: 2 busses, for each bus you need to provide the schedule, forexample:You may assume that: The input is syntactically correct: 4 digits followed by the name of a busstop on a new line. All times are valid and range from 0000 to 2359. Stops are input in the right (temporal) order. There are no overnight busses: Each bus will reach its final stop beforemidnight. Only valid bus stop names that have been input before will be used.QueriesAfter reading the network, your program should enable the user to search fora connection, by prompting the user to enter: From,To and desired arrivaltime, ArriveBy. For example :When you finish using the program, you should type done.Then your program should terminate, for example:Data Structures and Algorithms COMP9024 20T3Stage 1 (3 marks)For stage 1, you should demonstrate that you can read the input andgenerate a Suitable data structure.For this stage, all test cases will only use queries (From, To, ArriveBy) forwhich there is only one bus between From and To ; and this bus is guaranteed to arrive on, or before, the requested time,ArriveBy .Hence, all you need to do for this stage is find and output this bus connection,including all stops along the way and the arrival/departure times. Here is anexample to show the desired behaviour of your program for a stage 1 testData Structures and Algorithms COMP9024 20T3Stage 2 (5 marks)For stage 2, you should extend your program for stage 1 such that it alwaysfinds, and outputs, a connection between From and To that arrives on, or before, the requested time ArriveBy ; and departs as late as possible.You should assume that: Changing busses takes no time: Passengers arriving at a bus stop canget onto any other bus that leaves that stop at the same time or later. In all test scenarios there will be at most one connection that satisfiesall requirements.If there is no connection, the output should be:Here is an example to show the desired behaviour and output of yourprogram for a stage 2 test:Data Structures and Algorithms COMP9024 20T3Stage 3 (2 marks)For stage 3, you should extend your program for stage 2 such that:If there are two or more connections with the same latest departure time,choose the one with the earliest arrival time.Here is an Example to show the desired behaviour and output of yourprogram for a stage 3 test:Data Structures and Algorithms COMP9024 20T3Complexity Analysis (1 mark)Your program should include a time complexity analysis for the worst-caseasymptotic running time of your program, in Big-Oh notation, depending onthe size of the input:1. the number of bus stops, n2. the number of busses, m3. the maximum number k of stops on a bus line.HintsIf you find any of the following ADTs from the lectures useful, then you can,and indeed are encouraged to, use them with your program: linked list ADT : list.h, list.c stack ADT : stack.h, stack.c queue ADT : queue.h, queue.c graph ADT : Graph.h, Graph.c weighted graph ADT : WGraph.h, WGraph.cData Structures and Algorithms COMP9024 20T3You are free to modify any of the five ADTs for the purpose of theassignment (but without changing the file names). If your program isusing one or more of these ADTs, you should submit both the header andimplementation file, even if you have not changed them.Your main program file TripPlaner.c should start with a comment: /* */ that contains the time complexity of your program in Big-Oh notation,together with a Short explanation.TestingThe dryrun and additional test cases will be available soon, please test yourprogram with your own test cases until then.SubmitFor this project you will need to submit a file named TripPlaner.c and,optionally, any of the ADTs named Graph,WGraph,stack,queue,listthat your program is using, even if you have not changed them. You caneither submit through WebCMS3 or use a command line. For example, if yourprogram uses the Graph ADT and the queue ADT, then you should submit:Do not forget to add the time complexity to your main source code fileTripPlaner.c.You can submit as many times as you like later submissions will overwriteearlier ones. You can check that your submission has been received onWebCMS3 or by using the following command:MarkingThis project will be marked on functionality in the first instance, so it is veryimportant that the Output of your program be exactly correct as shown in theexamples above. Submissions which score very low on the automarking willbe looked at by a human and may receive a few marks, provided the code iswell-structured and commented.Data Structures and Algorithms COMP9024 20T3Programs that generate compilation errors will receive a very low mark, nomatter what other virtues they may have. In general, a program that attemptsa substantial part of the job and does that part correctly will receive moremarks than one attempting to do the entire job but with many errors.Style considerations include: Readability Structured programming Good commentingPlagiarismGroup submissions will not be allowed. Your program must be entirely yourown work. Plagiarism detection software will be used to compare allsubmissions pairwise (including submissions for similar projects in previousyears, if applicable) and serious penalties will be applied, particularly in thecase of repeat Offences. Do not copy ideas or Code from others Do not use a publicly accessible repository or allow anyone to seeyour code, not even after the deadlinePlease refer to the on-line sources to help you understand what plagiarism isand how it is Dealt with at UNSW: Plagiarism and Academic Integrity UNSW Plagiarism Policy Statement UNSW Plagiarism Procedure如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。