interface Sort{
void sort();
}
class QuickSort implements Sort{
@Override
public void sort() {
System.out.print("快排");
}
}
class BubbleSort implements Sort{
@Override
public void sort() {
System.out.print("冒泡");
}
}
class Strategy{
Sort mSort;
public void sort(int[] res){
if (res.length > 1000 * 1000){
mSort = new QuickSort();
}else {
mSort = new BubbleSort();
}
mSort.sort();
}
}