Example

Note that there are cases in which the expected running time of an algorithm is very fast, but there is no bound on the worst-case running time.


\begin{algorithm}
{HaveGirl}{}
 \begin{REPEAT}
 \mbox{\it kid} \= \mbox{\sc Rand...
 ...T}{\mbox{\sc sex}(\mbox{\em kid}) = \mbox{\em female}}\\  \RETURN\end{algorithm}


next up previous
Next: RANDOMIZED QUICKSORT Up: PROBABILITY THEORY Previous: Expected Running Time