Check the problem description here.

**Solution:**

As we recursively go to left and right , we replace child data , with root data, if the root is less than the root , so that while we come back the child of a node is always higher than the root…

Check the problem description here.

**Solution:**

As we recursively go to left and right , we replace child data , with root data, if the root is less than the root , so that while we come back the child of a node is always higher than the root…

Check out the problem description here.

class Solution:

def binaryTreePaths(self, root: Optional[TreeNode]) -> List[str]:

res=[]

ds=[]

self.rec(root,res,ds)…

Check out the problem description here.

*Solution*

`class Solution:`

def solve(self, A, B):

ds=[]

self.rec(A,B,ds)

return ds

def rec(self,root,B,ds):

if root ==None :

return False

ds.append(root.val)

if root.val == B:

return True

if self.rec(root.left,B,ds) or self.rec(root.right,B,ds):

return True

ds.pop(-1)

return False

*Time :O(N)*

** Space :O(h) height of the tree**…

Check the problem description here

Solution

*Recursive solution*

Recursively check if the mirror nodes are same.

`class Solution:`

def isSymmetric(self, root: Optional[TreeNode]) -> bool:

if root:

return self.helper(root.left,root.right)…

Check out the problem description here

*Solution*

Traverse level order, and pushing the nodes to queue with the node and its x coordinate(position of imaginary vertical line ) .While popping the node from queue keep updating the imaginary vertical line with latest value popped from the queue and which…

Check out the problem description here.

*Solution*

Traverse level order, and pushing the nodes to queue with the node and its x coordinate(position of imaginary vertical line ) .While popping the node from queue store the first node value for each imaginary vertical line in to a dictionary .Finally return…