Given a non-empty binary tree, find the maximum path sum.
For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child … Read More
Interview Questions asked in Google, Microsoft, Amazon
Given a non-empty binary tree, find the maximum path sum.
For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child … Read More
by Dhaval Dave
Given a Binary Tree, print the diagonal traversal of the binary tree
Consider lines of slope -1 passing between nodes. Given a Binary Tree, print all diagonal elements in a binary tree belonging to same … Read More
by Dhaval Dave
Find weather two given trees are isomorphic to each other or not.
Lets understand What is isomorphic strings
AAB and XXY are IsoMorphic to each other, consider A replaces/morphs as X and B as Y, … Read More
by Dhaval Dave
We are given a Binary Tree, Print the Right view of Binary tree,
Right view of binary tree is : List of all nodes which are visible If you look at Binary tree from right … Read More
by Dhaval Dave
If a binary tree is given, how to find Maximum path sum between two leaves of binary tree.
All should be numbers The maximum sum path may or may not go through root. For example, |
by Dhaval Dave
Trie also called prefix tree (as they can be searched by prefixes).
The term trie comes from retrieval.
In the example shown, keys are listed in the nodes and values below them. Each … Read More
by Dhaval Dave
by Dhaval Dave
by Dhaval Dave
[1]
by Dhaval Dave
[1] / \ [2] [3] / \ / \ [4] [5] [9] [10] / / \ [8] [6] [7]
say