Given the doubly linked list data structure discussed in the lecture, implement a subclass “DuplicateManipuationList” that has a new function for removing duplicates from a list.
Given the doubly linked list data structure discussed in the lecture, implement a subclass “DuplicateManipuationList” that has a new function for removing duplicates from
a list.
- Add a new method to your DuplicateManipuationList called removeDuplicates(…). The
method takes as an argument called ListToRemove that is a singly linked list that
contains some values. The method should scan the linked list for each member of the
ListToRemove, and remove all occurrences (not only the duplicates) of that member.
Besides updating the DuplicateManipulationList, the removeDuplicates(…) function
should return a new list that shows the number of duplicates for each deleted member.
Note:
That with inheritance:
- You have a parent class called “Node” that contain [data, *next, *prev] and a sub class
called “DuplicateManipuationList”
Trending now
This is a popular solution!
Step by step
Solved in 2 steps