132
Se consideră algoritmul X(n), unde n este un număr natural nenul ().
Algoritm 1
Algorithm X(n)
s ← 0
ind ← n
While ind > 0 execute
j ← 1
While j ≤ ind execute
s ← s + j + 5
j ← j * 5
ind ← ind DIV 5
EndWhile
EndWhile
Return s
EndAlgorithmCare este complexitatea de timp a algoritmului X(n)?
6 / 8