The list has nnn integers. Implement a test, where the sum of the n/10n/10n/10 smallest elements of the list is computed.
Implement the test in three different ways:
heapq.heappush
heapq.heapify
Perform the test using n=107n=10^7n=107 with each element chosen randomly from the range 1…1091 \dots 10^91…109. Check that each implementation returns the same answer.
In this task, you get a point automatically, when you report your results and the code you used, and push the submit button.
Time for Algorithm 1: s
Time for Algorithm 2: s
Time for Algorithm 3: s
The code you used: