Folloiwngs is the comments on the order of run time
- Task0 - O(1). Taking the first or last 1 slice of data from a list (https://wiki.python.org/moin/TimeComplexity)
- Task1 - O(n). Since there are several for loop for each data to add and search in a list. The run time is linear
- Task2 - O(n). This does not use sorting, and use iterating through a dictionry
- Task3 A - O(n log n). This uses SampleSort (list.sort())
- Task3 B - O(n). Check each call once at maximum
- Task4 - O(n). O(n log n). This uses Timesort (sorted())