As a good Java programming exercise I found the following exercise:
You are to write a ranking list in Java for the International Ski Federation. Write a class for a racer that stores a name, a race number and a time (as a double).
Write also a class RankingList which stores the racers sorted by time. It should be possible to insert racers and output the list of racers on the console. You can assume that there is always a maximum of 100 racers in a race. Also write a main or test method that shows how to create and output a ranking list with 2 racers.
I am able to write the class for a racer (incl. constructor). But for the class “RankingList” I don’t know how to enter the methods Sort, Insert and Print. Can someone help me there? Which data structure would be best here? A LinkedList or an array? Or can someone program the code?