ArrayList and LinkedList are both JFC implementations of the interface List. However, there are also differences between the two implementations and therefore it's important to know when to use one or the other data structure.

1 Present and discuss the differences between the two classes and indicate when it is recommended to use one or the other.
2. Consider a real world problem/application which requires a List data type as support data structure and discuss whether you should use an ArrayList or aLinkedList implementation.

Security check line at the airport

Requirements: Visualize how the line evolves during time.

Approach: Assume you are at the airport, waiting for the security check. There is one line (which is a FIFO queue), and 5 security check gates. Each person reaching in front of the queue is checked by the first available security gate. Each security check gate has its pace of handling passengers, as follows: gate #1, 1 person/minute, gates #2 and #3, 2 persons/minute, and gates #4 and #5, 3 persons/minute. Assume that initially there are 20 people in the line and each minute other 10 people are coming to the line. Show the evolution of the line in the first 10 minutes. For this, use a queue to model the line, add the initial passengers (give them names Passenger1, Passenger2, …, Passenger20), and start distributing them to security check gates every minute. In each minute (for 10 minutes), show the status as follows:
◦ Content of the line (the queue) at the beginning, and at end of the given minute (remember that each minute other 10 passengers enter the line);
◦ Content (that is people checked) of each of the 5 security check gates during the given minute.

Deliverables: You should submit (1) all the source (.java) files, (2) an output sample (screenshot showing program execution and the results of your testing) and (3) a document file describing your solution. The solution description document should include the following elements: a short problem analysis, main design decisions, assumptions, description of classes, user interface, testing and test cases, error handling and lessons learned. The size of the document should be of 3 pages, single spaced, font size 12.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

Java Programming Problems
    $55.00 for this solution

    PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

    Find A Tutor

    View available Java Programming Tutors

    Get College Homework Help.

    Are you sure you don't want to upload any files?

    Fast tutor response requires as much info as possible.

    Upload a file
    Continue without uploading

    We couldn't find that subject.
    Please select the best match from the list below.

    We'll send you an email right away. If it's not in your inbox, check your spam folder.

    • 1
    • 2
    • 3
    Live Chats