Using recursion to compute a 2d pyramid arrays weight

I am working on some homework about recursion and ive been struggling to understand how to do a few parts of the homework.

Part of the assignment we have to calculate the weight supported at each object. This is the weight of the object itself, plus half of the supported weight of the objects above it.

These are some of the tests my method should pass

public void RecursionTestComputePyramidWeightsInputTest() {

double [][] weights = {{}};

double [][] weights1 = {

{ 51.18 },

{ 55.90, 131.25 },

{ 69.05, 133.66, 132.82 },

{ 53.43, 139.61, 134.06, 121.63 }

};

Assert.assertEquals("ComputePyramidWeights...

Read More »

By: StackOverFlow - Monday, 19 November

Related Posts