Kotlinlearncs.online LogoJava
Return to List

Solve: Binary Tree Count Increasing

Created By: Pranav Narayanan
/ Version: 2025.2.0

Write a method named countIncreasing that accepts a single BinaryTree<Integer>? and counts the number of nodes in the tree that have at least one child node and whose child nodes all have values strictly greater than their parent's value. If the passed tree is null, return 0.

For reference, cs125.trees.BinaryTree is defined like this:

Related Lessons

Stuck? You may find these lessons helpful:

Report a Problem

Attribution must link to this page: https://www.learncs.online/solve/kotlin/binary-tree-count-increasing/[email protected]