Question: Option ExplicitSub generateNewProblem ( ) ' It generates a new case for knapsack problem ' It uses random numbers for weights, values and maximum weight
Option ExplicitSub generateNewProblemIt generates a new case for knapsack problem It uses random numbers for weights, values and maximum weight Dim W As Long Dim n As Long Dim i As Long Dim arrCase As Variant 'this array will contain the solution W Application.WorksheetFunction.RandBetween n ile arasnda deerler isteniyor ReDim arrCase To n To For i To n arrCasei i arrCasei Application.WorksheetFunction.RandBetween 'Value arrCasei Application.WorksheetFunction.RandBetween 'Weight Next i Temizleme ilemi: 'den sonraki satrlar temizle Rangeb:dClearContents rnek olarak satrdan satra kadar temizler Deerleri yerletir RangebResizen arrCase Rangec WEnd Sub
Please creare an algorithm for this code and explain the code clearly.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
