Kamus
Algoritma
If (n=1) or (n=0)
Then
Fak← 1
Else
If (n>1)
then
Fak← Faktorial(n-1)*n
Else
Fak←0
Endif
Endif
Endfunction
Operasi Dasar Utama : Perkalian
T(n) = T(n-1) * n dimana n > 1
T(n) = 1 + T(n-1)
T(n) = 1 + 1 + T(n-2) = 2 + T(n-2)
T(n) = 2 + 1 + T(n-3) = 3 + T(n-3)
T(n) = ...
T(n) = n + T(n-n)
T(n) = n + T(0)
T(n) = n + 0
T(n) = n
Jadi, T(n) = n
Tidak ada komentar:
Posting Komentar