Tip 1 : While Parcticing build a strong base of easy and medium questions
Tip 2 : Do 2 projects atleast
Tip 3 : Copetitive Programming helps
Tip 1 : Put only those things about which you are confident enough
Tip 2 : Keep it simple and short
It was at 10AM and in online mode.



The traversal should proceed from left to right according to the input adjacency list.
Adjacency list: { {1,2,3},{4}, {5}, {},{},{}}
The interpretation of this adjacency list is as follows:
Vertex 0 has directed edges towards vertices 1, 2, and 3.
Vertex 1 has a directed edge towards vertex 4.
Vertex 2 has a directed edge towards vertex 5.
Vertices 3, 4, and 5 have no outgoing edges.
We can also see this in the diagram below.
BFS traversal: 0 1 2 3 4 5

Declare a queue and insert the starting vertex.
Initialize a visited array and mark the starting vertex as visited.
Follow the below process till the queue becomes empty:
Remove the first vertex of the queue.
Mark that vertex as visited.
Insert all the unvisited neighbours of the vertex into the queue.



If we observe carefully, we will see that our main task is to print the right most node of every level. So, we will do a level order traversal on the tree and print the last node at every level
Its was at 3pm, The interviewer was 10 years+ experienced employee and eas very friendly. Helped me get comfortable also.



If the input tree is as depicted in the picture:
The Left View of the tree will be: 2 35 2
If we observe carefully, we will see that our main task is to print the left most node of every level. So, we will do a level order traversal on the tree and print the leftmost node at every level.



Input: Let the binary tree be:

Output: YES
Explanation: As we can see in the image, the original tree is the same as the mirrored tree.
The idea is to write a recursive function isMirror() that takes two trees as an argument and returns true if trees are the mirror and false if trees are not mirrored. The isMirror() function recursively checks two roots and subtrees under the root.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?