Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CS 207 - Homework 3 This homework is due on Monday April 3rd at 11:59p. To submit, follow the syllabus guidelines. Sorted Linked List Exercise
CS 207 - Homework 3 This homework is due on Monday April 3rd at 11:59p. To submit, follow the syllabus guidelines. Sorted Linked List Exercise (65 pts) Implement your code: In this question, you are required to implement a sorted linked list, sorted according to a person's m_ID eld. You must complete 4 methods in the class: SortedPersonList. You will be given two les, SortedPersonList . java and PersonNode . java. Implement these 4 methods: El contains(int ID) - this method takes an ID and checks whether a PersonNode associated with the given ID is in the list. If so, return true, otherwise, return false. CI get(int ID) This method takes an ID and checks whether a PersonNode associated with the given ID is in the list. If so, return the reference to the node, otherwise, return null. El add(int ID, String name) - This method takes an ID and a name and adds a PersonNode with these values into the list. The list must still be sorted in ascending order by ID numbers. If add is successful, return true. If the node already exists in the list, return false. D remove(int ID) This method takes an ID and remove a PersonNode associated with the given ID from the list. If remove is successful, return true. If no such node exists, return false
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started