算法分析技术概要概要.ppt

算法分析技术概要2007/06/11

算法分析技术求和技术Solvingsummations递归(分治)算法Solvingrecurrence估计与归纳证明法Thesubstitutionmethod递归树展开法Therecursion-treemethodThemastermethod快速排序算法及复杂度分析其他排序算法2

求和技术Solvingsummations:

Shiftingmethod——binaryinsertionsort

fori=1tonbiInsert(A[i],S);S:Sn=∑ki=1i*2i-1=1*20+2*21+3*22+4*23....+(i-1)*2i-2+i*2i-1+(i+1)*2i+…+k*2k-12*Sn=∑ki=1i*2i-1*2=∑ki=1i*2i=1*21+2*22+3*23+....+(i-2)*2i-2+(i-1)*2i-1+i*2i+1+…+(k-1)*2k-1+k*2kSn=k*2k-∑ki=22i-1+1=k*2k-2k+1=n*log(n)–n+13

Solvingsummations:Binaryinsertionsort

文档评论(0)

1亿VIP精品文档

相关文档