Solving 0/1 knapsack problem using C/C++ in different approaches