Efficiency of binary search
5 stars based on
In the analysis of algorithmsthe master theorem for divide-and-conquer recurrences provides an asymptotic analysis using Big O notation for recurrence relations of types that occur in the analysis of many divide and conquer algorithms. Saxe inwhere it was described as a "unifying method" for solving such recurrences. Not all recurrence relations can be solved with the use of this theorem; its generalizations include the Akra—Bazzi method. Consider a problem that can be solved using a recursive algorithm such as the following:.
Its call tree has a node for each recursive call, with the children of that node being the other calls made from that call. The leaves of the tree are the base cases of the recursion, the subproblems of size less than k that do not recurse. The above example would have a child nodes at each non-leaf node.
The total amount of work done by the entire algorithm is the sum of the work performed by all the nodes in the tree. This equation can be successively substituted into itself and expanded to obtain an expression for the total amount of work done. The master theorem sometimes yields asymptotically tight bounds to some recurrences from divide and conquer algorithms that partition an input into smaller subproblems of equal sizes, solve the subproblems recursively, and then combine the subproblem solutions to give a solution to the original problem.
The time for such an algorithm can be expressed by adding the work that they perform at the top level of their recursion to divide the problems into subproblems and then combine the subproblem solutions together with the time made in the recursive calls of the algorithm. The table below uses standard big O notation. The following equations cannot be solved using the master theorem: Therefore, the difference is not polynomial and the Master Theorem does not apply.
From Wikipedia, the free encyclopedia. For the result in enumerative combinatorics, see MacMahon Master theorem. For the result about Mellin transforms, see Ramanujan's master theorem. Practice Problems and Solutions", http: Retrieved from " https: Asymptotic analysis Theorems in computational complexity theory Recurrence relations Analysis of algorithms.