POWER(a,n)
- if n = 0 then
- return 1
- elseif n%2=0 then
- tmp ← POWER(a,n/2)
- return tmp * tmp
- else
- tmp ← POWER(a,(n-1)/2)
- return tmp * tmp * a
INSERTION_SORT(A)
- for i ← 1 to n-1 do
- v ← A[i]
- j ← i-1
- while j ≥ 0 and A[j] > v do
- [j+1] ← A[j]
- j ← j - 1
- A[j+1] ← v