x E x
E1E2x E1E2E
cx≤n/4 + n/4 = n/2
E1E2
E
Majoritaire(i, j) (x, cx)x
E[i..j]cx(−,0)
E[i..j]Majoritaire(1, n)Occurence(x, i, j)
x E[i..j]
Majoritaire(i, j)
i=j
(E[i],1)
(x, cx) = Majoritaire(i, b(i+j)/2c)
(y, cy) = Majoritaire(b(i+j)/2c+ 1, j)
cx6= 0
cx←cx+Occurence(x, b(i+j)/2c+ 1, j)
cy6= 0
cy←cy+Occurence(x, i, b(i+j)/2c)
cx>b(j−i+ 1)/2c
(x, cx)
cy>b(j−i+ 1)/2c
(y, cy)
(−,0)
C(n)
n
C(n) = 2(C(n
2) + n
2)C(1) = 0
C(n) = nlog2(n)
a≥1b > 1f(n)T(n)
T(n) = aT (n/b) + f(n)T(n)
f(n) = O(nlogba−) > 0T(n) = Θ(nlogba)
f(n) = Θ(nlogba)T(n) = Θ(nlogbalog n)
f(n) = Ω(nlogba+) > 0af(n/b)≤cf(n)
c < 1n T (n) = Θ(f(n))