![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
链表
StepForewardMonthly
STAY HUNGRY.STAY FOOLISH.
展开
-
链表的快排和归并排序
1、对于数组排序,请最好使用快速排序原理:algorithm quicksort(A, lo, hi) is if lo < hi then p := partition(A, lo, hi) quicksort(A, lo, p – 1) quicksort(A, p + 1, hi)algorithm partition(A, lo, hi原创 2016-05-16 23:06:21 · 413 阅读 · 0 评论 -
Leetcode:2. Add Two Numbers(Week 6)
Description:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers a原创 2017-10-14 19:13:47 · 131 阅读 · 0 评论 -
Simple Tree Traverse(遍历)
遍历算法 (the first node as the root node) 1.先(根)序遍历的递归算法定义: 若二叉树非空,则依次执行如下操作: ⑴ 访问根结点; ⑵ 遍历左子树; ⑶ 遍历右子树。 2.中(根)序遍历的递归算法定义: 若二叉树非空,则依次执行如下操作: ⑴遍历左子树; ⑵访问根结点; ⑶遍历右子树。 3.后(根)序遍历得递归算法定义: 若原创 2016-05-16 23:30:44 · 1071 阅读 · 0 评论