[O1] Big-O review (3 pts) [00JN]
For each of the following, answer with the best (smallest) upper bound from this list: O(1), O(\log n), O(n), O(n \log n), O(n^2), O(2^n). Give a brief justification for each.
- Number of leaves in a depth-n balanced binary tree
- Depth of an n-node balanced binary tree
- Number of edges in an n-node tree
- Time needed to sort a list of n items using merge sort
- Number of distinct subsets of a set of n items
- Number of bits needed to represent the number n in binary
- Time needed to find the closest pair of points among n points in Euclidean space by simply listing all the pairs
- Time needed to insert n items into a binary heap
- Time needed to find the second largest number in a sorted list of n distinct numbers
- Time needed to find the second largest number in an unsorted list of n distinct numbers