codesONLY / JavaScriptONLY

Knowledge Resource of core fundamentals of JavaScript explained in simple way!
382 stars 181 forks source link

LowestCommonAncestorOfaBinaryTree.js #73

Closed gunjapandey closed 2 years ago

gunjapandey commented 2 years ago

In Binary Trees Data Structure, I've proposed a solution to one of the most renowned interview questions asked in the "FAANG" firms. Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”

sohamsshah commented 2 years ago

camelCase form is needed.

gunjapandey commented 2 years ago

made the change :)