-
Recent Posts
Recent Comments
Archives
Categories
Meta
Category Archives: recursion
sum-of-left-leaves
package us.inest.app.dcp.recursion; import us.inest.app.dcp.tree.TreeNode; public class SumOfLeftLeaves { public static int sumOfLeftLeaves(TreeNode root) { // base case if (root == null) { return 0; } // left child is a leaf node if (root.left != null && root.left.left == null … Continue reading
Posted in recursion
Comments Off on sum-of-left-leaves