Knapsack in c++

the implementatin of fractinal knapsack

Page 1 of 1

4 Replies - 12628 Views - Last Post: 16 March 2010 - 10:22 AM Rate Topic: -----

#1 rockczar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 16-March 10

Knapsack in c++

Posted 16 March 2010 - 06:16 AM

I regirstered to get some code fragment for knapsack problem but could not find any.. Can anyone help?
THank you. RC
Is This A Good Question/Topic? 0
  • +

Replies To: Knapsack in c++

#2 Ferencn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 71
  • View blog
  • Posts: 322
  • Joined: 01-February 10

Re: Knapsack in c++

Posted 16 March 2010 - 07:30 AM

Google is your friend.
1st hit for "knapsack problem": Tadaaaa!!
There is a description, I will not give you code because:
Sorry, but we won't write your code or do your homework for you. Please re-read our rules/policies:
Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.
:code:

This post has been edited by Ferencn: 16 March 2010 - 07:31 AM

Was This Post Helpful? 1
  • +
  • -

#3 Munawwar  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 162
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: Knapsack in c++

Posted 16 March 2010 - 07:34 AM

You may visit this for 0-1 Knapsack.
Fractional knapsack here
Was This Post Helpful? 0
  • +
  • -

#4 Ferencn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 71
  • View blog
  • Posts: 322
  • Joined: 01-February 10

Re: Knapsack in c++

Posted 16 March 2010 - 07:40 AM

View PostMunawwar, on 16 March 2010 - 02:34 PM, said:

You may visit this for 0-1 Knapsack.
Fractional knapsack here

Yes, I found those and many more code snippets or solutions by changing the searchterms in Google.
I chose not to give those links directly so the OP could try and find some by himself!
If he can't be bothered to write his own code, he should at least take the effort to find it...

This post has been edited by Ferencn: 16 March 2010 - 07:48 AM

Was This Post Helpful? 0
  • +
  • -

#5 Munawwar  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 162
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: Knapsack in c++

Posted 16 March 2010 - 10:22 AM

View PostFerencn, on 16 March 2010 - 05:40 PM, said:

Yes, I found those and many more code snippets or solutions by changing the searchterms in Google.
I chose not to give those links directly so the OP could try and find some by himself!
If he can't be bothered to write his own code, he should at least take the effort to find it...

What shall I say? I think we need to write a tutorial on "How to use Google" :P
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1