Linked List Lab

11 Apr 2025 - 18:06 | Version 1 |

Learning Objective(s)

  1. Learn to implement and use a linked list
  2. Learn about priority queues

Overview of the Program

Create a problem that will maintain a list of patents for a hospital emergency room based on priority

Specifics

  • The program should be called ERroom
  • You must use a linked list. The final version should be a priority queue, but you can start with a regular queue.
  • Patents are treated based on the priority of their problem (with a first come first serve within that problem).
  • You should output the order in which the patents get treated.
  • Data file will be a series of lines.
    • an incoming patient line will have a number (1-5) and a name. The number indicates the severity of the problem with 5 being the worst
    • a -1 indicates that the next patient should be treated.
  • Output the patients in order that they are treated.
  • The program should get the name of the file from command line in its final version.

Sample dialogue (for the data file in the shared drive for this lab)

Order of service:
    Patient1
    Patient3
    Patient5
    Patient6
    Patient2
    Patient4

Phase 1

  • Create a UML diagram for:
    • LNode
    • LinkedList
    • Queue (subclass of LinkedList)
    • PriorityQueue (subclass of Queue)
    • ERroom (driver)
  • Create a testing plan including:
    • two sample files (besides the one given with expected results)
    • unit tests for two classes (at least one must be the Queue)
    • unusual tests

Phase 2

Using your graded software design report
  • Implement the program. I suggest the following:
    • Use a queue instead of a priority queue to get everything to work first
    • Ask the user for the file name instead of getting it from command line
    • Only when those two are working perfectly, implement a priority queue. I recommend when adding to the list, you add it sorted.
    • Only when that is working, convert the program to using the command line argument for the file name
  • create a Software Development Report incorporating any necessary changes from the software design report. Be sure to include detailed instructions on how to run your program, including any instructions for extra credit.
    • In Lessons Learned, include a section that talks about:
      • a discussion about what you learned about linked lists, queues, and priority queues
      • how using inheritance help (or hindered) the project
    • In Outside Resources Used discuss who did what (esp. in the shared portions of the lab)
  • create a zip folder containing only the following
    • A completed software development report
    • all the .java files needed to run all the games
    • any input files you might want to have the grader use when running the program

Submission

  • only one zip folder needs to be submit by one person in the group

Optional improvements

Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
  • Use an array of linked lists to implement the priority queue
  • Use a heap to implement a priority queue. (This is very hard at your level)
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback
This website is using cookies. More info. That's Fine