$11$ | $= 3 + 4 + 4 = 4 + 3 + 4$ $= 4 + 4 + 3.$ |
$\mathbf{Algorithm}\ \Fib(n)\mathrm{:}$
$\mathbf{if}\ n = 0\ \mathrm{or}\ n = 1$
$\mathbf{then}\ f = n$
$\mathbf{else}\ f = \Fib(n - 1) + \Fib(n - 2)$
$\mathbf{endif};$
$\mathbf{return}\ f$
$\mathbf{Algorithm} \text{ ElisaDrinksCider}(n):$
$\quad \mathbf{if}\ n = 1\ \mathbf{then}$
$\quad \quad \text{order Fibonachos}$
$\quad \mathbf{else}$
$\quad \quad \ElisaDrinksCider(n / 2);$
$\quad \quad \text{drink n bottles of cider};$
$\quad \quad \ElisaDrinksCider(n / 2)$
$\quad \mathbf{endif}$