Fibonacci
Kamus:
x,y,z,n,i
: integer
Algoritma:
Input(n)
x <-- 0
y <-- 1
z <-- 1
i <-- 1
While(i
<= n) do
Output(z,
' ')
i <-- i+1
z <-- x+y
x <-- y
y <-- z
Operasi dasar
|
C(n)
|
C(15)
|
Cop
|
Input/ß
|
5+4n
|
5+4(15)
|
a
|
<
|
n+1
|
15+1
|
b
|
+
|
2n
|
2(15)
|
C
|
Output
|
N
|
15
|
d
|
T(15) = Cop * C(15)
T(15) = 65a + 16b + 15c + 30d
T(n) = Cop * C(n)
T(n) = (5+4n)a + (n+1)b
+ (2n)c + (n)d
0 komentar:
Posting Komentar