sop(list);
//sop(Collections.max(list,new StrlenComp()));
Collections.sort(list);
int index = halfSearch(list,"af");
System.out.println(index);
}
public static void sop(Object obj)
{
System.out.println(obj);
}
public static int halfSearch(List<String> list,String key){
int max ,min,mid;
max = list.size()-1;
min = 0;
while(min<=max);
{
mid = (max+min)>>1;// /2
String str = list.get(mid);
System.out.println(str);
int num = str.compareTo(key);
if(num>0)
max = mid -1;
else if(num<0)
min = mid +1;
else
return mid;