Skip to content

Tag Archives: LCA

We strongly recommend to refer below post as a prerequisite of this.Heavy Light Decomposition | Set 1 (Introduction)In the above post, we discussed the Heavy-light… Read More
Heavy Light decomposition (HLD) is one of the most used techniques in competitive programming. Example Problem: Let us understand Heavy-light decomposition (HLD) with the help… Read More
The article describes an approach to solving the problem of finding the LCA of two nodes in a tree by reducing it to an RMQ… Read More
AucFind the distance between two keys in a binary tree, no parent pointers are given. The distance between two nodes is the minimum number of… Read More
What is Lowest Common Ancestor in Binary Tree? The lowest common ancestor is the lowest node in the tree that has both n1 and n2… Read More
Given two values n1 and n2 in a Binary Search Tree, find the Lowest Common Ancestor (LCA). You may assume that both values exist in… Read More

Start Your Coding Journey Now!