public class SortAndSelectDemo{ public static void main(String[] args){ int[] arr = {3, 5, 17, 2, 11, 13, 19, 7, 23}; //bubbleSort(arr); selectSort(arr); printArr(arr); int searchIndex = halfSearch(arr,6); System.out.println(searchIndex); } //选择排序 pu…