Welcome to Day 46 of the DSA Coding Challenge:
Todays Goals:
Question 1:Invert Binary Tree
Given the root of a binary tree, invert the tree, and return its root.
(Invert means swap every left node for its corresponding right node / get mirror image)
Question 2:Diameter of binary tree
Write a function which takes in the root of a binary tree and returns the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in the tree. It is not necessary for this path to pass through the root of the tree. The length of a path between two nodes is the number of edges between them.
All the best!