.
Observe that after in each recursive call,
this quantity deceases strictly.
So, it is enough to prove the algorithm
by induction on
, which is easy.
recursive calls.
operations in
word operations.
:
==
1 ifthen return
![]()
2 ifand
then return
![]()
3 ifand
then return
![]()
3 ifand
then return
![]()
4 ifthen return
else return
![]()
Marc Moreno Maza