递归方程:
[egin{cases}
f(n)=2f(n/2)+ccdot &n>1\\
f(1)=0 &n=1
end{cases}
]
换元:
[egin{array}[lcl]
s令quad k=2^n,f(n)=f(2^k)=h(k)\\\
则quad h(k)=2h(k-1)+2^k quadquad;\\\
故递归方程变为:egin{cases}
h(k)=2h(k-1)+2^k &k>0\\
h(0)=0 &k=0
end{cases}
end{array}
]
构造生产函数求解:
[egin{array}[lcl]
sG(x) =sum_{k=0}^{+infty}left[h(k)cdot x^k
ight] qquadqquadqquad (1)\\\
2xcdot G(x) =sum_{k=0}^{+infty}left[2h(k)cdot x^{k+1}
ight] qquad;;\,(2)\\\
(1)-(2)得:\\\
(1-2x)cdot G(x)=h(0)+sum_{k=0}^{+infty}left{left[hleft(k+1
ight)-2hleft(k
ight)
ight]cdot x^{k+1}
ight}\\\
qquadqquadqquad;;\,=h(0)+Ccdot sum_{k=0}^{+infty}(2^{k+1}cdot x^{k+1})\\\
qquadqquadqquad;;\,=h(0)+Ccdot left(frac{2x}{1-2x}
ight)\\\
herefore G(x)=frac{h(0)}{1-2x}+Ccdot left[frac{1}{left(1-2x
ight)^2}-frac{1}{1-2x}
ight]\\\
ecause h(0)=f(0)=0\\\
herefore G(x)=Ccdot sum_{k=0}^{+infty}left[kcdot(2x)^k
ight]\\\qquadquad;\,=
sum_{k=0}^{+infty}left[ccdot kcdot (2x)^k
ight]\\\
herefore h(k)=C cdot k cdot 2^k\\\
又ecause n=2^k
herefore f(n)=ccdot nlog_2n
end{array}
]