>
> thnx a lot chi n mohan...
>
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For mo
> http://rosettacode.org/wiki/Knapsack_problem/0-1
> http://jhave.org/learner/misc/knapsack/knapsack.shtml
On Oct 30, 4:26 pm, Rashmi Shrivastava wrote:
> pls any one give me solution of this question with detailed description,
>
> Find an optimal solution to the Knapsack instance
> n=7,m=15,(p1,
i used this code but its giving me segmentation fault.
vectorans;//maintains the list of selected objects
for(int x=t-1;x>0;x--)//t is the no. of objects
{ if(knap[x][tt]!=knap[x-1][tt])//tt is the capacity of knapack
{
ans.push_back(ar[x].index);
tt=tt-ar
NO! (in a word).
The whole restraint in the knapsack problem is that there is NO way to
somehow "trim" an item that's just a little too large, down to the
ideal size, or to increase the capacity of the knapsack to accomodate
the items we'd like it to ideally, hold.
It seems to me that if the "kn