Question: ANSWER ASAP Question 1 - 35 pts) Design and implement an algorithm to delete all the duplicate elements in a List ADT implemented as




\
ANSWER ASAP
Question 1 - 35 pts) Design and implement an algorithm to delete all the duplicate elements in a List ADT implemented as a singly linked list. You are given the code for the singly linked list-based implementation of a List ADT. The main function in this program is already setup to generate random integers and fill up the contents of the list (IntegerList). The delete DuplicateElements() function is called on the IntegerList to delete the duplicate occurrences of all the elements in the list. Your task is to implement the delete DuplicateElements() function in the singly linked list-based implementation of the List ADT. Your algorithm/implementation should run in time less than or equal to ncomparisons (which is the basic operation), where n is the number of elements in the list before the deletions. The main function is written in such a way that it will print the contents of the list before and after the deletions. You would test your code by entering 15 as the list size and 5 as the maximum value for any element. The list will be then filled with random integers in the range [1...5]. As there are going to be 15 integers in the list, it will be definitely the case that there will be more than one occurrence for one or more integers in the list. A sample output is shown below: Enter the maximum value in the list: 5 Enter the size for the list: 15 Before deletion: 53253221155 4315 After deletion: 5 3 214 #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
