Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Exercise 3 - Doubly Linked Lists 1. Open Double LinkedNode.java and BuildDLL.java in Eclipse and examine the code in both classes. 2. The Double
Exercise 3 - Doubly Linked Lists 1. Open Double LinkedNode.java and BuildDLL.java in Eclipse and examine the code in both classes. 2. The Double LinkedNode class is complete and does not have to be modified. 3. The BuildDLL class has some provided methods for creating a doubly linked list with a sequence of letters (note that we are using the Character class for this, which is a wrapper for the primitive char type) and printing out the list from front to rear. Run the program to see the default output. 4. Notice that the original list is printing correctly, but the remove () method is not provided so subsequent list outputs are incorrect. 5. You must fill in the code for removing an element from the linked list using the following rules and hints: Loop through the list until you find the correct node (how can you tell if the node is the one for which we are searching?) We will assume that the input parameter 'elem' will always be a valid element that is contained in the list. Normally we would have to account for elements that are not found in the list, but you may ignore this possibility for this lab. What are the 3 possible cases of the node's location in the list? How must each of these cases be handled? Make the appropriate connections with the previous and/or next node based on its position in the list. (Hint: remember front's previous is null and rear's next is null). 6. Run the program and check that the output is correct. The list after each step should be: KTENPAL (original) KTEPAL TEPAL (after removing 'N') (after removing 'K') (after removing 'L')
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To solve the problem you need to implement the remove method in the BuildDLL class This method should handle the three possible cases when removing an ...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