A
UBB · Informatică
204 Raspunsuri multiple

Se consideră algoritmul ceFace(v, st, dr), unde v este un vector de n numere întregi (−10^9 ≤ v[1], v[2], ..., v[n] ≤ 10^9), iar st și dr sunt limitele indicilor (1 ≤ st ≤ dr ≤ n).

Algoritm 1

Algorithm ceFace(v, st, dr)
  If st = dr then
    Return v[st]
  EndIf
  mij ← (st + dr) DIV 2
  s1 ← ceFace(v, st, mij)
  s2 ← ceFace(v, mij + 1, dr)
  Return max(s1, s2)
EndAlgorithm

Care dintre următoarele afirmații despre funcție sunt false?

17 / 30