Why can't greedy promise the best knapsack, and how does a take/don't-take tree check every combination at a cost of 2ⁿ⁺¹ − 1 nodes?
Short drills on what this video just taught. Write the code, run the checks, and reveal the answer only if you are stuck.
A take/don't-take search tree is built over 5 items. Build the list level_counts whose entry at index is the number of nodes at depth , from the root (depth 0) down to the leaves (depth 5). Then assign the total number of nodes in the tree to total.