Se consideră algoritmul afla(n, x), unde n este număr natural (1 ≤ n ≤ 104), iar x este un vector cu n elemente numere întregi (x[1], x[2], ..., x[n], -100 ≤ x[i] ≤ 100, pentru i = 1, 2, ..., n):
Algorithm afla(n, x):
M ← x[1]
For i ← 1, n execute
For j ← i, n execute
For k ← j, n execute
If M < x[i] + x[j] + x[k] then
M ← x[i] + x[j] + x[k]
EndIf
EndFor
EndFor
EndFor
Return M
EndAlgorithmCare este complexitatea timp a algoritmului?
Alegeți toate variantele corecte.