Browse all published articles from our writers
this is combination sum problem
In this article, we break down Leetcode 572: Subtree of Another Tree in the simplest way possible—perfect for beginners and even kids learning trees for the first time. You’ll learn what a subtree really means through easy-to-understand examples, including both valid and invalid cases. We walk through the problem intuition, explain the recursive approach step by step, and provide clean Python code that compares two trees node by node. Along the way, we also cover the time and space complexity, helping you understand not just how the solution works, but why it works. If you're trying to build a solid foundation in binary trees and recursion, this guide is a must-read.
In this blog, we explore the classic Same Tree problem, where we determine whether two binary trees are structurally identical and have the same node values. We'll break down the problem, build an intuitive understanding, and implement an elegant recursive solution.
This blog explains how to determine the maximum depth of a binary tree, covering both recursive and iterative approaches with clear examples. Ideal for coding interview prep or strengthening your data structure fundamentals.