1. Convert sorted array to bst. 2. Find in-order successor to a given node in binary tree.
Anonymous
public static TNode convert(int[] a,int low,int high){ if(low>high) return null; int mid=(low+high); mid=mid/2; TNode root=new TNode(a[mid]); root.left=convert(a,low,mid-1); root.right=convert(a, mid+1, high); return root; }
Check out your Company Bowl for anonymous work chats.