Leetcode 742 Closest Leaf in a Binary Tree - Java Solution using DFS & BFS
If you find this video helpful, please 'Like' & 'Subscribe'. This is really helpful for the channel and also motivates me to do more of such good videos. Leetcode 742 Closest Leaf in a Binary Tree Lintcode 854 · Closest Leaf in a Binary Tree Java Solution explained using DFS & BFS. Link To The Problem: https://leetcode.com/problems/closest-leaf-in-a-binary-tree/ https://www.lintcode.com/problem/854/ Problem Description: Given a binary tree where every node has a unique value, and a target key k. Find the value of the nearest leaf node to target k in the tree. If there are multiple cases, you should follow these priorities: The leaf node is in the left subtree of the node with k; The leaf node is in the right subtree of the node with k; The leaf node is not in the subtree of the node with k. Youtube channel: https://www.youtube.com/channel/UCrvpRH4lSRjp2T6btl0lf4w https://github.com/maksrane100/leetcode_solutions #coding #softwareengineer #Leetcode #Algorithm #DataStructure #Java #programmer #tech #software #codinglife #Preparation #interview #programminglife #programmingisfun #dfs #bfs #queue #binarytree #hashset #leetcode #leetcode742
If you find this video helpful, please 'Like' & 'Subscribe'. This is really helpful for the channel and also motivates me to do more of such good videos. Leetcode 742 Closest Leaf in a Binary Tree Lintcode 854 · Closest Leaf in a Binary Tree Java Solution explained using DFS & BFS. Link To The Problem: https://leetcode.com/problems/closest-leaf-in-a-binary-tree/ https://www.lintcode.com/problem/854/ Problem Description: Given a binary tree where every node has a unique value, and a target key k. Find the value of the nearest leaf node to target k in the tree. If there are multiple cases, you should follow these priorities: The leaf node is in the left subtree of the node with k; The leaf node is in the right subtree of the node with k; The leaf node is not in the subtree of the node with k. Youtube channel: https://www.youtube.com/channel/UCrvpRH4lSRjp2T6btl0lf4w https://github.com/maksrane100/leetcode_solutions #coding #softwareengineer #Leetcode #Algorithm #DataStructure #Java #programmer #tech #software #codinglife #Preparation #interview #programminglife #programmingisfun #dfs #bfs #queue #binarytree #hashset #leetcode #leetcode742