Write a function same_values(l, m) that returns True if the lists l and m contain the same values, i.e. every element of l is in m and every element of m is in l. You may assume that all list elements are immutable.
Write a program that reads text until the end of input is reached, and prints out the most common word in the input text, along with its number of occurrences.
Write a program that reads a string and print out the five most common characters in the string along with their occurrence counts, e.g.
e 23 t 20 o 18 n 15 i 14
Write the characters in decreasing order of frequency. The string may contain any Unicode characters.
Write a function that takes a list of integers and returns True if there are any duplicate values in the list. Use sorting to accomplish this task. Do not modify the original list.
Write a function with the same behavior, using a set to accomplish the task.
Which implementation do you think will be faster on a large list in the best case? In the worst case?
As an experiment, generate a list of 1,000,000 integers in the range from 1 to 1,000,000,000, then call both of the above functions on your list. How does the exection time compare?
Modify the experiment so that all the integers your generated list are unique. Now run both functions on your list. How does the execution time compare?