Suppose we have the following function:
def sort_list(list_of_strings):
"""Take a list of strings, sort the letters in each string,
and then sort the full list. The list is modified in place."""
for i in range(len(list_of_strings)):
list_of_strings[i] = ''.join(sorted(list_of_strings[i]))
list_of_strings.sort()
Would it be correct to say that this has big-O notation of O(n)
because the length of time it takes for the function to run depends on the length of list_of_strings
?