본문 바로가기

# IT, Computer Science/Algorithm

Master theorem (마스터 이론)

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

Divide and conquer algorithm에서 time complexity를 구할 수 있는 공식




T(n) = a \; T\left(\frac{n}{b}\right) + f(n)


-> 두 식 모두 표현 가능함.



  • 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


-> b로 나누어 a개로 풀음, f(n)은 sub에서 합치는 시간.

-> 합치는 시간에 따라 3가지 케이스로 나뉘어 time complexity 추정 가능함.











예시)





http://en.wikipedia.org/wiki/Master_theorem

'# IT, Computer Science > Algorithm' 카테고리의 다른 글

셀프넘버 (Self Number)  (0) 2012.02.18
Bloom filter(블룸 필터)  (0) 2009.12.16
Binary search tree  (0) 2009.11.14
Full Binary Tree and Complete Binary Tree  (1) 2009.10.07
Infix to Postfix  (2) 2009.10.04