Trimming a binary tree

Code to trim a binary tree, between two boundary inputs. public class TrimBinarySearchTree { public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x;[…]

Read more

Cloning a graph

Cloning a graph is one of the easier problems. A quick code demonstrates this … import java.util.*; public class CloneGraph { public class Node{ int val = 0; List neighbors[…]

Read more

The fruits in basket problem

You have a list of integers which are fruits. Each int value is a fruit type You have two baskets Each baskets can ONLY contain ONE type of fruit. What[…]

Read more
Terms of Use | Privacy Policy 
2018-2019 © eXitDiscount