|
Orbital library | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorbital.algorithm.template.DivideAndConquer
public class DivideAndConquer
Framework (template class) for Divide and Conquer Algorithms.
top-down technique
DivideAndConquerProblem| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface orbital.algorithm.template.AlgorithmicTemplate |
|---|
AlgorithmicTemplate.Configuration |
| Constructor Summary | |
|---|---|
DivideAndConquer()
|
|
| Method Summary | |
|---|---|
Function |
complexity()
≈O(n*log n). |
java.lang.Object |
solve(AlgorithmicProblem p)
Generic solve method for a given algorithmic problem. |
java.lang.Object |
solve(DivideAndConquerProblem p)
solves by divide and conquer. |
Function |
spaceComplexity()
Measure for the asymptotic space complexity of the central solution operation in O-notation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DivideAndConquer()
| Method Detail |
|---|
public java.lang.Object solve(AlgorithmicProblem p)
AlgorithmicTemplate
solve in interface AlgorithmicTemplatep - algorithmic problem hook class which must fit the concrete
algorithmic template framework implementation.
Function.apply(Object)public java.lang.Object solve(DivideAndConquerProblem p)
public Function complexity()
More precisely, if you have a recurrence T(n) that describes the running time of a divide and conquer algorithm that divides a problem of size n into p subproblems of size n/d, each, and the cost of dividing and merging a problem of size n is f(n), you can apply the master theorem to find an precise asymptotic bound for the running time T(n).
| T(n) in | { | Θ(nlogdp) | <= exist ε>0 f(n) in O(nlogdp-ε) |
| Θ(nlogdplogn) | <= f(n) in Θ(nlogdp) | ||
| Θ(f(n)) | <= exist ε>0 f(n) in Ω(nlogdp+ε)
and exist c<1 pf([n/d]) =< cf(n) p.t. n in N |
complexity in interface AlgorithmicTemplateAlgorithmicTemplate.solve(AlgorithmicProblem)public Function spaceComplexity()
AlgorithmicTemplate
spaceComplexity in interface AlgorithmicTemplateAlgorithmicTemplate.solve(AlgorithmicProblem)
|
Orbital library 1.2.0: 23 Apr 2008 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||