Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

with this methods complete this table Size of input array MaxPairwiseProduct1withNumSteps MaxPairwiseProduct2withNumSteps 3 10 50 100 200 500 1000 public static int MaxPairwise Product1withNum Steps(int[]

image text in transcribed

image text in transcribed

with this methods complete this table

Size of input array

MaxPairwiseProduct1withNumSteps

MaxPairwiseProduct2withNumSteps

3

10

50

100

200

500

1000

public static int MaxPairwise Product1withNum Steps(int[] A) { int numSteps = 0; // we declare and initialize our number of steps. int maxProduct = 0; numSteps++; // for the declaration of maxProduct as a step numSteps+=2; // for the declaration of i and checking the condition i maxProduct if (A[i]*A[] > maxProduct) { maxProduct = A[i]*AD); numSteps++; // for the update of maxProduct } numSteps += 2; // for the update of j checking the condition j A[indexMax] if (A[i] > A[indexMax]) { indexMax = i; numSteps++; // for the update of indexMax } numSteps += 2; // for the update of i and checking the condition i A[indexMax]) if (i != indexMax && A[i] > A[indexMax2]) { indexMax2 = 1; numSteps++; // for the update of indexMax } numSteps += 2; // for the update of i and checking the condition i AindexMax]) is not public static int[] costMaxPairwise Product10 { // one int per cost, one average cost per size (3, 10, 50, 100, 200, 500, 1000) int[] sizes = {3, 10, 50, 100, 200, 500, 1000); int[] averages = new int[7]; for (int i=0; i maxProduct if (A[i]*A[] > maxProduct) { maxProduct = A[i]*AD); numSteps++; // for the update of maxProduct } numSteps += 2; // for the update of j checking the condition j A[indexMax] if (A[i] > A[indexMax]) { indexMax = i; numSteps++; // for the update of indexMax } numSteps += 2; // for the update of i and checking the condition i A[indexMax]) if (i != indexMax && A[i] > A[indexMax2]) { indexMax2 = 1; numSteps++; // for the update of indexMax } numSteps += 2; // for the update of i and checking the condition i AindexMax]) is not public static int[] costMaxPairwise Product10 { // one int per cost, one average cost per size (3, 10, 50, 100, 200, 500, 1000) int[] sizes = {3, 10, 50, 100, 200, 500, 1000); int[] averages = new int[7]; for (int i=0; i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

dy dx Find the derivative of the function y=(4x+3)5(2x+1)2.

Answered: 1 week ago

Question

Draw and explain the operation of LVDT for pressure measurement

Answered: 1 week ago