GFG-POTD | Root to leaf path sum using Java | 12 July 2024 | Tree | Data Structures | Java
ฝัง
- เผยแพร่เมื่อ 14 ต.ค. 2024
- Geeks-for-Geeks | Practice Problem
12 July 2024
Problem : Root to leaf path sum using Java
Level : Easy
Language : Java
Topics Tag : Tree | Data Structures
____________________________________________________
⬇️ You may also visit my another playlists :
👉 LeetCode Problems :
• LeetCode Problems
👉 Code360 by coding ninja's mcq solution :
• Coding Ninjas | MCQ Da...
👉 Geeks-for-Geeks :
• Geeks-for-Geeks Problems
--------------------------------------
Stay connected with me on social media for more updates and behind-the-scenes content !
You can find me on 🔍:
📱 Instagram Profile :
/ _ganesh_p09
🌐 LinkedIn Profile :
/ ganesh-prasad09
-----------------------------------------------------
➡️ Problem Statement as follows :
Given a binary tree and an integer target, check whether there is a root-to-leaf path with its sum as s.
Examples :
Input: tree = 1, target = 2
/ \
2 3
Output: false
Explanation: There is no root to leaf path with sum 2.
Input: tree = 1, target = 4
/ \
2 3
Output: true
Explanation: The sum of path from leaf node 3 to root 1 is 4.
Expected Time Complexity: O(n)
Expected Auxiliary Space: O(height of tree)
---------------------------------------------------------
🔔 If you enjoyed the content, please subscribe to the channel for more updates! 📺
👍 If you found this video helpful, don't forget to give it a thumbs up and share it with your friends! 📤
🙏 Thank you for watching the video! 😊
------------------------------------------------
📚 Check out other problems! 🔍:
🧩 1. Partitions with Given Difference | Java | GeekforGeeks | Practice Problem
• GFG-POTD | Partitions ...
🧩 2. K-Palindrom | Java | GeeksforGeeks | Practice Problems
• GFG-POTD | K-Palindrom...
🧩 3. [ Part-02 ] Maximum Score Words Formed by Letters - Leetcode
• 1255. [Part-01] Maximu...
🧩4. Mobile Numeric Keypad :
• GFG-POTD | 📱Mobile num...
🧩 5. Boring Factorial ( Coding Ninjas ) :
• ✅ Coding Ninjas Easy C...
🧩 6. Coverage of all Zeros in a binary matrix
• GFG-POTD | Coverage of...
🧩 7. Make Binary Tree From Linked List :
• GFG-POTD | Make Binary...
--------------------------------------------------
#gfgproblems
#gfgsolutions
#gfgproblemoftheday
#roottoleafpathsum
#roottoleafpathsumusingjava
#roottoleafpathsumsolution
#roottoleafpathsumgfgsolution
#roottoleafpathsumproblemoftheday
#roottoleafpathsumproblemofthedaysolution
#roottoleafpathsumgfgproblemoftheday