Modify the singly linked list to be a doubly linked list. Now write a routine that removes all duplicate data in the doubly linked list. The data will be integers generated at random from [0,49]. Initially have a list of 200 elements.
Methodology:
Now do this in one of two ways.
Sort the list by its data field.
Remove adjacent elements of the sorted list with the same value.
Or, take the first element—search the remainder of the list for elements with the same data and remove them.
Then take the second element and do the same. Repeat until only one element is left.