The number isA direct search over every -element subset must inspect candidates. Testing one candidate by generating its subset sums creates values; storing previously seen sums detects a collision. Generating them incrementally needs arithmetic operations, or for the straightforward independent calculation of each sum. Thus the simple overall search has cost on the scale of , apart from integer-arithmetic and data-structure costs.
The important time complexity distinction is that fixed gives polynomial growth in , of degree , but this can still become impractically large. If increases with , both the candidate count and the internal power set can grow exponentially. For example, near the binomial coefficient is already exponentially large. An exhaustive implementation can therefore encounter a combinatorial explosion; the fixed- estimate must not be described as exponential in .
Articles by others on the same topic
There are currently no matching articles.