![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
HG_weikaifang
这个作者很懒,什么都没留下…
展开
-
快速排序
import java.util.Arrays;public class FastSort { public static void main(String []args){ System.out.println("Hello World"); int[] a = {12,20,5,16,15,1,30,45,2,9}; int start = 0...原创 2018-03-18 20:28:50 · 190 阅读 · 0 评论 -
选择排序
public class selectSort { /** * 选择排序 * * @param args */ public static void main(String[] args) { Integer[] aa = { 11, 5, 2, 4, 7 }; int min = 0; int temp = 0; for (int i = 0; i < aa.length...原创 2018-03-24 16:50:04 · 147 阅读 · 0 评论 -
插入排序
public class InsertArray { // 数组 private long[] arr; // 数组中有效数据的大小 private int elems; // 默认构造函数 public InsertArray() { arr = new long[50]; } public InsertArray(int max) { arr = new long[max]; } // 插...原创 2018-03-24 16:53:33 · 161 阅读 · 0 评论 -
冒泡排序
ublic class BubArray { // 数组 private long[] arr; // 数组中有效数据的大小 private int elems; //默认构造函数 public BubArray() { arr = new long[50]; } public BubArray(int max) { arr = new long[max]; } // 插入数据 publi...原创 2018-03-24 16:54:45 · 153 阅读 · 0 评论 -
二叉树的三种遍历
Public class Node { // 关键字 private int keyData; // 其他数据 private int otherData; // 左子节点 private Node leftNode; // 右子节点 private Node rightNode; public Node(int keyData, int otherDate) { this.keyData...原创 2018-03-24 17:06:55 · 239 阅读 · 0 评论 -
全排列
public class Allperm { public static void swap(int []aa,int a,int b){ int temp=aa[a]; aa[a]=aa[b]; aa[b]=temp; } public static void perm(int []aa,int from ,int to){ if(fro...原创 2018-03-29 16:15:31 · 164 阅读 · 0 评论