Skip to content
StackDecode
Dynamic programmingExplained

State Compression DP

Pack a large state into a small integer.

Time

O(2ⁿ · n)

Extra space

O(2ⁿ)

Use it for

Broken-profile and subset problems.

An animated walkthrough for this algorithm isn’t built yet. The summary above explains the idea; see the related animated algorithms below to practise the same technique.