
算法
hioaduf
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
排序篇:quick
[size=medium][b]快速排序quickSort[/b][/size] [code="java"] public class Test { public static void main(String[] args) { int arr[] = {3, 5, 6, 333, 5, 2, 1111, 1, 2, 3, 4, 5, 6, 7, 8, 8}; ...原创 2015-06-25 00:08:47 · 129 阅读 · 0 评论 -
排序篇:heap
public static void heapSort() { int[] arr = {0, 5, 6, 333, 5, 8, 999, 7, 7, 5, 45, 3}; int heapSize = arr.length - 1;//堆的大小, buildHeap(arr, heapSize);//建堆,递归调用maxHeapify System.ou...原创 2015-11-08 21:27:54 · 145 阅读 · 0 评论 -
排序篇:bubble
public static void bubbleSort() { int[] arr = {0, 5, 6, 333, 5, 8, 999, 7, 7, 5, 45, 3}; for (int i = arr.length - 1; i > 0; i--) { for (int j = arr.length - 1; j > arr.lengt...原创 2015-11-08 21:41:04 · 119 阅读 · 0 评论