Int Tree Sum Assignment

From CSE231 Wiki
Revision as of 17:32, 2 February 2023 by Cosgroved (talk | contribs) (Created page with "=Code To Implement= ==IntTree== {{CodeToImplement|IntTree|sum()|inttree.group}} ===sum=== {{Sequential|public int sum()}} =Testing Your Solution= ==Client== {{Client|IntTreeS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Code To Implement

IntTree

class: IntTree.java Java.png
methods: sum()
package: inttree.group
source folder: student/src/main/java

sum

method: public int sum() Sequential.svg (sequential implementation only)

Testing Your Solution

Client

class: IntTreeSumClient.java CLIENT
package: inttree.client
source folder: student/src/main/java
IntTree intTree = new IntTree(1,
		new IntTree(2),
		new IntTree(3),
		new IntTree(100,
				new IntTree(231),
				new IntTree(425)),
		new IntTree(4));
int sum = intTree.sum();
System.out.println(sum);

should produce the output:

766

Correctness

class: _IntTreeSumTestSuite.java Junit.png
package: inttree.group
source folder: testing/src/test/java