Question: Find Duplicates Write a function called find_dups that takes a list of int's as a parameter and returns a list of values that are duplicated

 Find Duplicates Write a function called find_dups that takes a listof int's as a parameter and returns a list of values that

Find Duplicates Write a function called find_dups that takes a list of int's as a parameter and returns a list of values that are duplicated in the given list. For example, if the given list contains values {10, 20,10,30,40,20,10}, the list returned by your function should contain values {10,20}. The order of the values in the returned list is not important, but the returned list should not contain any duplicates (i.e. the example had three 10 's, but 10 shows up only once in the returned list). You will need to devise an algorithm for finding the duplicates. Suggestions will be given in class. You are free to use any member functions of the list class or functions included in the algorithm library. Once you have completed the function and tested it, determine the run-time (Big Oh) of your function. Remember to consider the run times of any library functions used as part of the solution. Explain how you arrived at the run-time, and note any assumptions you may have made regarding the run-times of any library functions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!