private static Edge createTree(Edge edges[],int low,int high){
  if (low > high) {
    return null;
  }
  int mid=(low + high) >>> 1;
  Edge newNode=edges[mid];
  newNode.left=createTree(edges,low,mid - 1);
  newNode.right=createTree(edges,mid + 1,high);
  if (newNode.left != null) {
    newNode.max=Math.max(newNode.max,newNode.left.max);
  }
  if (newNode.right != null) {
    newNode.max=Math.max(newNode.max,newNode.right.max);
  }
  return newNode;
}

private static Edge createTree ( Edge edges [ ] , int low , int high ) { if ( low > high ) { return null ; } int mid = ( low + high ) > > > 1 ; Edge newNode = edges [ mid ] ; newNode . left = createTree ( edges , low , mid - 1 ) ; newNode . right = createTree ( edges , mid + 1 , high ) ; if ( newNode . left != null ) { newNode . max = Math . max ( newNode . max , newNode . left . max ) ; } if ( newNode . right != null ) { newNode . max = Math . max ( newNode . max , newNode . right . max ) ; } return newNode ; }
creates tree from sorted edges ( with range low and high inclusive )
