Skip to content

Latest commit

 

History

History

235-lowest-common-ancestor-of-a-binary-search-tree

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

235. Lowest Common Ancestor of a Binary Search Tree

Runtime: 32 ms Your runtime beats 96.18 % of cpp submissions.
Memory Usage: 23.4 MB Your runtime beats 100 % of cpp submissions.

https://leetcode.com/submissions/detail/327569400/

alt text
alt text

Given that the tree is "sorted" (BST) we do need Euler Tour. Just find the items and compare their paths.