Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started