Dynamic programmingExplained
Bitmask DP
Encode which items are used as bits in an integer state.
Time
O(2ⁿ · n)
Extra space
O(2ⁿ)
Use it for
Small sets: assignment, TSP.
Encode which items are used as bits in an integer state.
Time
O(2ⁿ · n)
Extra space
O(2ⁿ)
Use it for
Small sets: assignment, TSP.