def tree_width(N, to_binary=False):
 if (N < 32):
  group_size = 2
 else:
  group_size = int(math.log(N))
 num_groups = (N // group_size)
 if (to_binary or (num_groups < 16)):
  return (2 ** int(math.log((N / group_size), 2)))
 else:
  return num_groups

def tree_width ( N , to_binary = False ) : if ( N < 32 ) : group_size = 2 else : group_size = int ( math . log ( N ) ) num_groups = ( N // group_size ) if ( to_binary or ( num_groups < 16 ) ) : return ( 2 ** int ( math . log ( ( N / group_size ) , 2 ) ) ) else : return num_groups
generate tree width suitable for merge_sorted given n inputs the larger n is .