In practice one should almost always use the "combo" algorithm to solve 0-1 knapsack problems. It will likely be orders of magnitude faster than any of these approaches (for medium-large instances, at least). There's code and references here: https://hjemmesider.diku.dk/~pisinger/codes.html