Some Microsoft Interview Problem Solution-2

Problem:FindReverse of a tree.

Problem:Balance check of a binary tree.

A tree is height balanced if difference between heights of left and right subtrees is not more than one for all nodes of tree.

Problem:Find Maximum Width of Tree.
Maximum width is maximum number of nodes in any level. The problem also given in Flipkart
interview.

Problem Link

Problem:Find nodes of K distance from root
Print all nodes that are at distance k from root (root is considered at distance 0 from itself).It was given as question in Amazon interview.

Problem Link

 

Problem:Print the words of a given sentence reverse order separated by (.). Sentence will contain words and fullstops(.).

C++ Solution:

python Solution:

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *