Up:
Previous:
Analysis
T(n)
+ T(7n/10 + 6) + O(n)
To get T(7n/10 + 6), note that the smallest partition size would be
7n/10 + 6 denotes number of elements in larger partition
Assume T(n)
cn for
and 7n/10+6
T(n) = O(n)
T(n)
c(n/5) + c(7n/10 + 6) + O(n)
= cn/5 + c7n/10 + c6 + O(n)
= 1/10(2cn + 7cn + 60c + O(n))
cn
2cn + 7cn + 60c + O(n)
10cn
60c + O(n)
cn
c(n - 60)
O(n)
c
O(n) / (n - 60)
c is a valid constant for large enough n.
Stopping condition: T(n) =
, if n
80
Up:
Previous: