Given n objects and knapsack of capacity m. Each object i has a weight wi and profit pi
The objective is to fill the knapsack to maximum profit but keep the total weight ≤ m
If an object i is placed in into the knapsack, then the profit of pi is earned.
The problem is solved using the Backtracking Algorithm.
Watch this video for the algorothm to solve this problem • Back tracking algorithm for 0 1 Knapsack P...
The 4 queens / n queen problems are also solved using backtracking algorithms.
See here • The 4 queen problem
To know more join my Udemy course on Design and Analysis of Algorithm
https://www.udemy.com/course/algorith...