public static void insertionSort(Comparable []data){  
        for(int index=1;index<data.length;index++){  
            Comparable key = data[index];  
            int position = 0;  
            //升序排列
//            while( position>0 && data[position-1].compareTo(key)>0){  
//                data[position] = data[position-1];  
//                position--;  
//            }  
//            data[position]=key;
            while(position < index && data[position].compareTo(key) <= 0)
            {
            	position++;
            }
            
            if(position < index){
            	Comparable temp=data[position];
	            for(int i=position;i<=index;i++)
	            {
	            	data[position]=key;
	            	Comparable tem=data[position+1];
	            	data[position+1]=temp;
	            	temp=tem;
	            }
            }
        }     
    }