issues
search
ishangoyal13
/
fullstackDevelopment
Material & Projects related to full stack development
125
stars
207
forks
source link
Lowest Common Ancestor of Deepest Leaves
#560
Closed
rajbir21-droid
closed
2 years ago
rajbir21-droid
commented
3 years ago
Description π
Given the root of a binary tree, return the lowest common ancestor of its deepest leaves.
The lowest common ancestor of a set S of nodes, is the node A with the largest depth such that every node in S is in the subtree with root A.
Created a solution using pair<TreeNode*,int> where TreeNode is the structure for binary tree and the pair keep the track of
the node with its respective level
Fixes #366
Type of change π
[x] Code
[ ] Documentation (Content Creation in the form of codes or tutorials)
[ ] Notes (Handwritten notes, cheatsheets, presentations, mind-maps)
[ ] Web Dev Projects
[ ] Others (If you choose other, Please mention changes below)
Programming Language
[ ] C#
[x] C++
[ ] Python
[ ] Java
[ ] Javascript
[ ] Others
Domain of Contribution π
[ ] Introduction
[ ] Data Structures
[ ] Algorithms
[ ] Competitive Programming
[ ] Mathematics
[ ] Bit Magic
[ ] Recursion
[ ] Arrays
[ ] Searching
[ ] Sorting
[ ] Matrix
[ ] Hashing
[ ] String
[ ] Linked List
[ ] Stacks
[ ] Queue
[ ] Deque
[x] Tree
[ ] Binary Search Tree
[ ] Heap
[ ] Graph
[ ] Greedy
[ ] Backtracking
[ ] Dynamic Programming
[ ] Trie
[ ] Segment Tree
[ ] Disjoint Set
[ ] Others
Checklist β
[x] I follow Contributing Guidelines & Code of conduct of this project.
[x] I have performed a self-review of my own code or work.
[x] I have commented my code, particularly in hard-to-understand areas.
[x] My changes generates no new warnings.
Screenshots / Gif (Optional) πΈ
Description π
Type of change π
Programming Language
Domain of Contribution π
Checklist β
Screenshots / Gif (Optional) πΈ