• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
May 07, 2024 |120 Views
SDE Sheet - Lowest Common Ancestor in a BST
Description
Discussion

This video is part of the BST section under GFG SDE Sheet.

In this problem, we are given a Binary Search Tree (with all values unique) and two node values n1 and n2 (n1!=n2). Find the Lowest Common Ancestors of the two nodes in the BST.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Article: https://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-search-tree/
Problem: https://www.geeksforgeeks.org/problems/lowest-common-ancestor-in-a-bst/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/