![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
洋子_
这个作者很懒,什么都没留下…
展开
-
Java 实现深度遍历和广度遍历数及其应用
一、深度遍历和广度遍历原理及实现1、深度优先英文缩写为DFS即Depth First Search.其过程简要来说是对每一个可能的分支路径深入到不能再深入为止,而且每个节点只能访问一次。对于上面的例子来说深度优先遍历的结果就是:A,B,D,E,I,C,F,G,H.(假设先走子节点的的左侧)。深度优先遍历各个节点,需要使用到堆(Stack)这种数据结构。stack的特点是是先进后出。整个遍历过...转载 2018-10-16 15:16:41 · 404 阅读 · 0 评论 -
手写快速排序算法——QuickSort(Java代码实现)
QuickSort/** * @program: JavaTest * @description: 快速排序实现 * @author: yanghaoran * @create: 2019-05-26 12:17 **/public class QuickSort { static int[] a = {4, 5, 7, 1, 9, 8, 3, 2, 6}; // 结...原创 2019-05-26 13:45:52 · 831 阅读 · 0 评论 -
手写堆排序算法——HeapSort(Java代码实现)
HeapSort/** * @program: JavaTest * @description: 手写堆排序 * @author: yanghaoran * @create: 2019-05-27 20:35 **/public class HeapSort { static int num = 0; public static void main(String[]...原创 2019-05-28 20:06:20 · 797 阅读 · 0 评论