Assignment 3

Deadline: Nov. 25th, 2022, CET

Exercises

3.1 Find kth highest element in an unsorted list

Using ideas from the quick-sort algorithm, find the kth highest element in an unsorted list. If there are duplicates in your list, they should occupy the same rank. In case there is not kth element, your function should return None.

For example, given the list [6, 5, 3, 3, 4], the function should return:

You are not allowed to use any function that sorts your input!

Note: We are including two test files which are exactly the same: one uses pytest, while the other one contains the same tests as unittests in case you have trouble running pytest.

Wrapping up

Do not forget to