随笔分类 - 数据结构
摘要:``` package test; public class MergeSort { public static void main(String[] args) { // TODO Auto generated method stub int[] arr = { 10, 9, 8, 7, 6, 5
阅读全文
摘要:``` package test; public class HeapSort { public static void main(String[] args) { int[] arr = {10,9,8,7,6,5,4,3,2,1}; System.out.print("排序前;"); print
阅读全文
摘要:``` package demo; public class ShellSort { public static void main(String[] args) { int[] arr = {5,4,3,2,1,0}; printArr(arr); shellSort(arr); printArr
阅读全文
摘要:``` package demo; / 快速排序; @author Lynn / public class QuickSort { public static void main(String[] args) { int[] arr = { 50, 10, 90, 30, 70, 40, 80, 6
阅读全文
摘要:``` package demo; / 插入排序; @author Lynn / public class InsertionSort { public static void main(String[] args) { int[] arr = {10,7,2,4,8,6,1,9}; System.
阅读全文
摘要:
阅读全文
摘要:``` package demo; / 简单排序 时间复杂度O(n^2) 不稳定; @author Lynn / public class SimpleSelectSort { public static void main(String[] args) { int[] arr = {10,7,2,
阅读全文
摘要:概念 二叉排序树,又称二叉查找树。它或者是一棵空树,或者是具有下列性质的二叉树: ①若它的左子树不空,则左子树上所有节点的值均小于它的根节点的值。 ② 若它的右子树不空,则右子树上所有节点的值均大于它的根节点的值。 ③ 它的左右子树也分别为二叉排序树。
阅读全文
摘要:使用邻接矩阵进行存储 原图 调整后 package graph; import java.util.ArrayList; import java.util.LinkedList; public class BFSTraverse { private static ArrayList list = n
阅读全文
摘要:使用邻接矩阵进行存储; package graph; import java.util.ArrayList; public class DFSTraverse { private static ArrayList list = new ArrayList(); // 邻接矩阵存储; public s
阅读全文

浙公网安备 33010602011771号