Array-related operations
Public class ArryShuzu {public static Integer [] arr = new Integer [10]; public static int element; /*** Delete element * @ param I * @ param target */public static void del (int I, Integer [] target) {for (int j = I; j <target. length-1; j ++) {target [j] = target [j + 1] ;}} /*** insert element at specified position * @ param index * @ param data * @ return */public static Integer [] inset (int index, int data) {if (arr [index] = null) {for (int j = 0; j <index; j ++) {arr [j] = 0;} element = index; arr [index] = data; return arr ;} /*** if the length of the element is not enough, the original data will not be squeezed out. ** else {* Integer [] newArray = new Integer [arr. length + 1]; * for (int j = 0; j <= arr. length; j ++) * {if (j
Index; j --) {arr [j] = arr [j-1];} arr [index] = data; element = arr. length; return arr ;}}/*** display data * @ param arr */public static void showDate () {for (int I = 0; I <= element-1; I ++) {System. out. println (arr [I]);}/*** insert data sequentially * @ param data */public static void insert (int data) {int I; for (I = 0; I <element; I ++) {if (arr [I]> data) {break ;}for (int j = element; j> I; j --) {arr [j] = arr [j-1];} arr [I] = data; element ++ ;} /*** locate element position */public static int showInde (int data) {int I; for (I = 0; I
Data) {pow = mindle-1;} else low = mindle + 1 ;}}}