I started writing an example (because this is an exceptionally easy question), but I thought better of it: doing your homework for you isn't right.
Hint: it's really easy to come up with a function involving nested loops where the best case and the worst case are both n-squared.
Last edited by dugan; 10-04-2010 at 11:03 PM.
|