With the first four problems, it helped me to watch lecture 8 again. I think I have them all right, but I may have deduced the answer incorrectly. My biggest concern is how to handle statements like if not in c that are in for loops (Does the search count as a loop in itself? If so, wouldn't it make it quadratic?) Any comments would be appreciated.
Problem 1
Has a complexity of O(n). It's a recursive function that has about 3n+f(i-n) steps in it.
Problem 2
Has a complexity of O(n). There are about 3+3n steps, making it have a linear growth.
Problem 3
Has a complexity of O(n). There are about 3+3n steps (unless the if statement counts as a loop within a loop, then it'd be quadratic)
Problem 4
Has a complexity of O(n). There are 3+2(3+3n)+3n, or 9+9n steps (because the makeSet function, which has a for loop within it is being used).