Question 28
Consider the followed randomized algorithm, which prints out some number of smiley faces (:)) and some number of asterisks () :
def randomizedSmiles (A): n = len(A) if n ≤ 1: print ":)" return for i in {0,...,n-1}: print "*" Choose a uniformly random integer p in {1, \ldots, n-1} randomizedSmiles(A[:p]) randomizedSmiles (A[p:])For the following parts, choose the tightest big-Oh bound that applies.
Based on the above data, answer the given subquestions.