public static <T extends Comparable<T>> T findMinElement(List<T> list, int begin, int end){

        if(begin==end){
            return list.get(begin);
        }
        T result=findMinElement(list, begin, end-1);
        if(result.compareTo(list.get(end))<0){
            return result;
        }
            return list.get(end);

    }