BACKTRACKING ALGORITHM – KNAPSACK PROBLEM
Aim:
To write a C program to solve the
knapsack problem using backtracking algorithm
Algorithm:
Step 1: Declare
the variables, array size and functions
Step
2: Get the value of number of objects and size of knapsack
Step 3: Enter
weight and profit of objects
Step 4: Assign
the initial values
Step 5: Call the
necessary function and display the profit
Step 6: End of
program
Coding: