"Day 75: Checking Univalue Binary Tree with Java Recursion"

🚀 Day 75 / 100 Days of Code 🌳 Problem: Check if a Binary Tree is Univalue A tree is univalue if all nodes contain the same value. ✅ My Approach Recursively check both left and right subtree If a node doesn't match the root value → return false Base case: null nodes naturally return true Result: 0 ms runtime, beating 100% submissions 🚀 💡 Takeaway Recursion really shines when validating conditions across tree structures. 🧩 Tech Stack: Java </> Algorithm | Recursion | Trees #100DaysOfCode #LeetCode #Java #DataStructures #CodingJourney #ProblemSolving #LinkedList

  • graphical user interface, text, application

To view or add a comment, sign in

Explore content categories