随笔分类 -  Java

摘要:public static class IdAscendingComparator implements Comparator<Student> { //返回负数的时候,第一个参数排在前面 //返回正数的时候,第二个参数排在前面 //返回0的时候,谁在前面无所谓 @Override public i 阅读全文
posted @ 2021-08-15 20:36 zh_小猿 阅读(121) 评论(0) 推荐(0)
摘要:1、递归实现 package search; import java.util.ArrayList; import java.util.List; //注意:使用二分查找的前提是 该数组是有序的. public class BinarySearch { public static void main 阅读全文
posted @ 2021-07-28 23:44 zh_小猿 阅读(34) 评论(0) 推荐(0)
摘要:算法总结对比 1、冒泡排序 public class BubbleSort { public static void main(String[] args) { // int arr[] = {3, 9, -1, 10, 20,7}; // System.out.println("排序前:"+Arr 阅读全文
posted @ 2021-07-28 23:44 zh_小猿 阅读(131) 评论(0) 推荐(0)