02: Tree structure – calculate average recursively & iteratively in Java

Q. Complete the following “TreeProcessingImpl” class ….. so that the unit tests shown below pass? Skeleton Code

Unit Tests

A. Solution 1:

Solution 2: Using recursion for getAverage(…) and iteration for getSum(…)

Key…

This content is for 100-Day-Full-Access, 200-Day-Full-Access, 365-Day-Full-Access, and 2-Year-Full-Access members only.

Register

50+ Free Java FAQs

50+ Free Big Data FAQs

Already a member? Log in here

300+ Java Interview FAQs

Tutorials on Java & Big Data