I have already done that
I cant change the loop
I dont know what is my stopping terms
User Profile
Collapse
-
need help to build a recursive function
hello.
I have a problem to build a recursive function
The function gets an array of prices, an array of weight and and spesific Price.
the output's function is the minimum weighet of the subset and the summry of the subset values is equall or bigger then the specific Price.
help me to build the function in a recursive way. (C)
thank you -
sorry
I have tried to dived the problem to smaller problems
i though it will be easy for you.Leave a comment:
-
this is my problem
A thief has a knapsack of a certain capacity. He looks around and sees different items of different weights and values. He would like the items he chooses for his knapsack to have the greatest value possible yet still fit in his knapsack. The problem is called the 0-1 Knapsack Problem because the thief can either take (1) or leave (0) each item.
out put the best value in minimum weight and an array...Leave a comment:
-
help with recursion
hello.
I have an array of int and a number
I need to build a recursion that print all the sub groups that if I summarize them, the summery is smaller then the number .
if some one can help me and write me the code I will be greatful.
Thank you.
No activity results to display
Show More
Leave a comment: