the correct answer is (b)
If you go through this heuristic approach you will get the value will be:
first, find value per wt--->
ob1: 3/7=0.42
ob2: 6/3=2
ob3: 8/5=1.6
ob4: 1/1=1
ob5: 2/4=0.5
ob6: 5/2=2.5
ob7: 7/6=1.16
Then arrange in descending order:
Ob6--> ob2--> ob3--> ob7--> ob4-->ob5-->ob1
now calculate the profit: (5+6+8+7+1+2=29)
The second question it is asking whether it is optimal or not:--->
to check this we need to try for normal 0/1 knapsack hit and trial to see whether it is possible to get more than 29 in 0/1 knapsack keeping maximum wt. of 24.
Ob3 5 8
Ob7 6 7
Ob2 3 6
Ob6 2 5
Ob1 7 3
Ob4 1 1
total 24 30
As we can see we can get profit of 30 without using that heuristic approach in 0/1 knapsack. therefore the heuristic approach is definitely not optimal.