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

Fibonacci Hashing : How do we find out what this Fibonacci Hashing is?

In real world Fibonacci hashing is not implemented or used even a part of it, because it’s actually more (Time and Space) … Read More

by Dhaval Dave

Interleave List If input = [[1,2,3], [9, 0], [5], [-4,-5,-2,-3,-1]] then output = [1,9,5,-4,2,0,-5,3,-2,-3,-1];

Asked in Facebook F2F… Read More

by Dhaval Dave

Given a 2d grid containing either values either 0 or 1 where 1 represents land and 0 represents water. You have to calculate the number of total islands in the given grid. An … Read More

by Dhaval Dave

Given a set T containing a list of integers and a sum S, does a subset of T exists whose sum is equal to S.

NOTE – Subset … Read More

by Dhaval Dave

Question is to sort a Stack in place without using extra Stack or other Data Structure.Answer :

Basic solution which comes in mind is to pop all element and sort and push into Stack again.

… Read More Basic solution which comes in mind is to pop all element and sort and push into Stack again.

by Dhaval Dave