Ok, well, one thing I've been having issues with that I'm sure isn't right is with my includeArray[]
How does one go about handling an array that they don't know the length of until the while loop below has been iterated through?...
User Profile
Collapse
-
Ah, thanks, I'm kinda rusty on my arrays, and Java in general... and for some reason I couldn't figure out the syntax for that.Leave a comment:
-
-
0-1 Knapsack Problem and the Greedy Algorithm
Ok, so, for those of you that are unfamiliar with the 0-1 Knapsack problem, I have to write an to take the weights and corresponding values of 10 items, and find which items to put in a knapsack that holds 85 pounds to have the maximum value in the knapsack.
I keep getting compiler errors, and quite honestly, I'm really bad at debugging.
Code:
[CODE=Java]
// The "Knapsack" class.
public...
No activity results to display
Show More
Leave a comment: