1.For the following question - make sure you document it with comments in the code.
2.You must use classes Time1 and BusArrival - You can get those classes in the zip file attached OR here - https://gist.github.com/rootux/69b4909a090ceae2eb35
3.Also make sure that for each method you have a documentation in the header.
4.Make sure that the name of the methods would be exactly as written.
5.The result is 1 file - BusArrivalNode.java zipped inside a file.
6.Write as a comment on the API what is the time complexity and the place complexity of every method you wrote.
Class BusArrivalNode represents a single item in the linked list.
Class will include the two attributes:
1. BusArrival _busArr
2. BusArrivalNode _next
U must write the constructors and the methods that are necessary in class.
For this class you have to define three constructors:
1. public BusArrivalNode (BusArrival b)
Receive the bus arrival (an object from class BusArrival) next_ field will be set to null.
2. public BusArrivalNode (BusArrival b, BusArrivalNode n)
Gets the bus arrival (object from class BusArrival) and another item n from type BusArrivalNode. The constructor would init the attributes by the given parameters. _next field will point to n.
3. public BusArrivalNode (BusArrivalNode b)
Copy constructor. Notice you have to copy the information (next) itself and not a copy of the pointer. Which means in this case aliasing is the right thing.
The methods in class BusArrivalNode are:
* public BusArrival getBusArr() – returns a copy of the bus arrival.
* public BusArrivalNode getNext()- returns pointer to the next item. Notice that aliasing is not a mistake here either. You need to return the pointer next and not a copy of the pointer.
* public void aetBusArr (BusArrival b) - receives the bus arrival and update the arrival attribute in the vertex.
* public void setNext(BusArrivalNode next) - receives a pointer and update the pointer attribute to the next item. Notice that aliasing is not a mistake here either. You need to update the information (next) itself and not a copy.20160130184602time1_and_busarrival.zip