## فرح حسن @FARAH_HASAN

نقاط السمعة -1
تاريخ التسجيل 05/03/2017
آخر تواجد أكثر من 3 سنوات

ممكن مساعدة

Write a program to solve the Knapsack problem using hill climbing algorithm. Your code should contain a method called Knapsack, the method takes two parameters, the first is a 2xN array of integers that represents the items and their weight and value and the second is an integer that represents the maximum weight of the knapsack. Assume that the initial state is an empty Knapsack, and the actions are either putting objects in the Knapsack or swapping objects from in and out of the Knapsack.

Your method should print (on the screen) three lines:

The first one represent the chosen items(indices), the second line gives the total weight of the selected items and the last one represent the total value of the selected items.

An example:

weight 5 3 6 12 7

value 2 3 4 7 1

total weight 20

Output:

0 1 3

20

12

Your code should run in real time.

ارجوك ساعدني في كتابة البرنامج بال سي شارب

Write a program to solve the Knapsack problem using hill climbing algorithm. Your code should contain a method called Knapsack, the method takes two parameters, the first is a 2xN array of integers that represents the items and their weight and value and the second is an integer that represents the maximum weight of the knapsack. Assume that the initial state is an empty Knapsack, and the actions are either putting objects in the Knapsack or swapping objects from in and out of the Knapsack.

Your method should print (on the screen) three lines:

The first one represent the chosen items(indices), the second line gives the total weight of the selected items and the last one represent the total value of the selected items.

An example:

weight 5 3 6 12 7

value 2 3 4 7 1

total weight 20

Output:

0 1 3

20

12

Your code should run in real time.

بليز حد يساعدني

Write a program to solve the Knapsack problem using hill climbing algorithm. Your code should contain a method called Knapsack, the method takes two parameters, the first is a 2xN array of integers that represents the items and their weight and value and the second is an integer that represents the maximum weight of the knapsack. Assume that the initial state is an empty Knapsack, and the actions are either putting objects in the Knapsack or swapping objects from in and out of the Knapsack.

Your method should print (on the screen) three lines:

The first one represent the chosen items(indices), the second line gives the total weight of the selected items and the last one represent the total value of the selected items.

An example:

weight 5 3 6 12 7

value 2 3 4 7 1

total weight 20

Output:

0 1 3

20

12

Your code should run in real time.

-1

بليز حد يساعدني

Write a program to solve the Knapsack problem using hill climbing algorithm. Your code should contain a method called Knapsack, the method takes two parameters, the first is a 2xN array of integers that represents the items and their weight and value and the second is an integer that represents the maximum weight of the knapsack. Assume that the initial state is an empty Knapsack, and the actions are either putting objects in the Knapsack or swapping objects from in and out of the Knapsack.

Your method should print (on the screen) three lines:

The first one represent the chosen items(indices), the second line gives the total weight of the selected items and the last one represent the total value of the selected items.

An example:

weight 5 3 6 12 7

value 2 3 4 7 1

total weight 20

Output:

0 1 3

20

12

Your code should run in real time.

.

لك في مجال الذكاء الاصطناعي؟