摘要:
//两数交换不用中间变量public class TwoChange { public static void main(String[] args) { int a = 3, b = 5; //第一种方式采用加减法实现 /* a = a + b; b = a - b; a = a - b;*/ / 阅读全文
摘要:
快速排序是冒泡排序的改进,效率比较高,基本思想也是两两相比较。 阅读全文
摘要:
//冒泡排序//冒泡排序要经过N-1步的中间排序才能排完,效率较低public class BublleSort { public static void main(String[] args) { int[] arr = {1, 56, 36, 74, 2, 6, 3, 21, 5}; bubbl 阅读全文