At 7:50 (mm:ss) - For storing paths, assuming that the binary tree is not skewed, the space required is O(log N). Otherwise, O(N) space is required in the case of the Skew Tree.
@harshvivek143 жыл бұрын
Massst bhai 🔥🙌🏻
@ashutoshtiwari51383 жыл бұрын
woww amazing concepts
@hridikasaha95193 жыл бұрын
amazing explanation sir
@shwetachavan5843 жыл бұрын
Thank you so much sir..🔥🔥
@dsaa2z3 жыл бұрын
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode': return self.lca(root,p,q) def lca(self,root,p,q): if root ==None: return None elif root == p or root==q: return root else: left = self.lca(root.left,p,q) right = self.lca(root.right,p,q) if left==None and right==None: return None elif left!=None and right!=None: return root elif left==None: return right elif right==None: return left
@Entertainment-lz5ei3 жыл бұрын
The way you are explaining the problem theory and it's solution is so cool . So please continue this process.
@dsaa2z3 жыл бұрын
That was an awesome aproach 🔥🔥🔥
@surabhsaxena79283 жыл бұрын
To be honest,sir you have made DFS look so easy.👏👏 Simply a masterpiece🔥🔥👌👌
@Innoskrit3 жыл бұрын
😇💝
@amansrivastava8343 жыл бұрын
Is this playlist covers all topic asked from trees in interview??
@Innoskrit3 жыл бұрын
Yes, few topics are left they will also be uploaded very soon. But you'll get every single topic and question from Tree Data Structure in this playlist.
@RishabhMishra-uw9yb3 жыл бұрын
Best explanation lekin kaashi itna deemag coding round mein chalta
@Innoskrit3 жыл бұрын
Chalega Boss! Jis din deemaag mein sab code example chhap jayenge, us din chalega.