Diameter of a Binary Tree in O(n) [A new method]

The diameter of a tree is the number of nodes on the longest path between two leaves in the tree. The diagram below shows two… Read More »

Diameter of a tree using DFS

The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two leaves in the tree. The… Read More »

Salesfoce Interview Experience |Set 2 (On-Campus For SDE )

Recently salesforce visited our campus and took the following rounds for the final selection. Round 1: Written aptitude round containing basic questions on C and… Read More »

Salesforce Interview Experience | Set 1 (For SDE-1)

I have recently attended an interview with Salesforce Hyderabad, for SDE-I position. There are 5 rounds in total, all are technical. I. Programming Round: 1.… Read More »

Calculate the angle between hour hand and minute hand

This problem is know as Clock angle problem where we need to find angle between hands of an analog clock at a given time. Examples:… Read More »

Diameter of a Binary Tree

The diameter of a tree (sometimes called the width) is the number of nodes on the longest path between two end nodes. The diagram below… Read More »