Udacity Data Structures Algorithms Project1 Unscramble CS Problems

Big O Analysis

Task 0:

Worst case time-complexity is O(1) Time-complexity is O(1) because we are accessing the first and last value from the lists by an index.

Task 1:

Worst case time-complexity is O(n) Time-complexity is O(n) because we are accessing all the values in the list

Task 2:

Worst case time-complexity is O(N^2) Time-complexity is O(N^2) because of nesting in operator

Task 3:

Worst case time-complexity is O(logN) Time-complexity is O(logN) because of sorting

Task 4:

Worst case time-complexity is O(logN) Time-complexity is O(logN) because of sorting