Master theorem 主定理及其应用算法
Generic form The master theorem concerns recurrence relations of the form: In the application to the analysis of a recursive algorithm, the constants and function take on the following significance: n is the size of the problem. a is the number of subproblems in the recursion. n / b is the size of each subproblem. (Here it is assumed that all subproblems are essentially the same size.) f ( n ) is the cost of the work done outside the recursive calls, which includes the cost of dividing the problem and the cost of merging the solutions to the subproblems. Application to common algorithms Algorithm Recurrence Relationship Run time Comment Binary search O (log( n )) Apply Master theorem where f ( n ) = n c [3] Binary tree traversal O ( n ) Apply Master theorem where f ( n ) = n c [3] Optimal Sorted Matrix Search O ( n ) Apply Akra-Bazzi theorem for p = 1 and g ( u ) = log( u ) ...