随笔分类 -  算法

1
摘要:一、问题 https://leetcode-cn.com/problems/move-zeroes/ 给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。 示例: 输入: [0,1,0,3,12] 输出: [1,3,12,0,0] 说明: 必须在原数组上操作 阅读全文
posted @ 2020-01-17 16:09 落花流水Zxxxx 阅读(352) 评论(0) 推荐(0)
摘要:一、问题 https://leetcode-cn.com/problems/merge-two-sorted-lists/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MergeTwoListsClass.cs B 阅读全文
posted @ 2020-01-07 19:59 落花流水Zxxxx 阅读(606) 评论(0) 推荐(0)
摘要:一、问题https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MaxDepthClass.cs B 阅读全文
posted @ 2020-01-06 17:06 落花流水Zxxxx 阅读(618) 评论(0) 推荐(0)
摘要:一、问题 https://leetcode-cn.com/problems/invert-binary-tree/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/InvertTreeClass.cs Blog:htt 阅读全文
posted @ 2020-01-06 11:59 落花流水Zxxxx 阅读(438) 评论(0) 推荐(0)
摘要:一、问题 https://leetcode-cn.com/problems/hamming-distance/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/HammingDistanceClass.cs Blog: 阅读全文
posted @ 2020-01-02 16:17 落花流水Zxxxx 阅读(394) 评论(0) 推荐(0)
摘要:一、问题 https://leetcode-cn.com/problems/merge-two-binary-trees/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MergeClass.cs Blog:http 阅读全文
posted @ 2020-01-02 11:22 落花流水Zxxxx 阅读(267) 评论(0) 推荐(0)
摘要:一、问题 https://leetcode-cn.com/problems/largest-sum-of-averages/solution/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/Class813.cs B 阅读全文
posted @ 2019-11-01 16:06 落花流水Zxxxx 阅读(443) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/detect-capital/submissions/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/Class520.cs Blog:https: 阅读全文
posted @ 2019-10-24 15:26 落花流水Zxxxx 阅读(256) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/search-in-rotated-sorted-array/submissions/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/Class33 阅读全文
posted @ 2019-10-23 11:51 落花流水Zxxxx 阅读(248) 评论(0) 推荐(1)
摘要:问题:https://leetcode-cn.com/problems/search-a-2d-matrix-ii/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/SearchMatrixClass.cs Blog:ht 阅读全文
posted @ 2019-03-19 18:04 落花流水Zxxxx 阅读(617) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/majority-element/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MajorityElementClass.cs Blog:http 阅读全文
posted @ 2019-03-19 12:04 落花流水Zxxxx 阅读(302) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/single-number/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/SingleNumberClass.cs Blog:https://ww 阅读全文
posted @ 2019-03-18 17:29 落花流水Zxxxx 阅读(315) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/number-of-islands/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/NumIslandsClass.cs Blog:https:// 阅读全文
posted @ 2019-03-18 16:48 落花流水Zxxxx 阅读(556) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/EvalRPNClass.cs B 阅读全文
posted @ 2019-03-15 14:46 落花流水Zxxxx 阅读(724) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/daily-temperatures/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/DailyTemperaturesClass.cs Blog: 阅读全文
posted @ 2019-03-14 10:44 落花流水Zxxxx 阅读(369) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/valid-parentheses/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/ValidParentheses.cs Blog:https:/ 阅读全文
posted @ 2019-03-13 10:19 落花流水Zxxxx 阅读(430) 评论(0) 推荐(0)
摘要:问题:https://leetcode-cn.com/problems/perfect-squares/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/NumSquares.cs Blog:https://www.cnb 阅读全文
posted @ 2019-03-07 15:08 落花流水Zxxxx 阅读(714) 评论(0) 推荐(0)
摘要:思路:使用先进先出的队列,广度优先搜索,使用字典可大幅减少遍历时间 问题:https://leetcode-cn.com/problems/open-the-lock/submissions/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/bl 阅读全文
posted @ 2019-03-06 14:24 落花流水Zxxxx 阅读(505) 评论(0) 推荐(0)
摘要:一、代码实现循环队列思路:使用数组存储数据,两个指针保存队列头尾问题:https://leetcode-cn.com/problems/design-circular-queue/ 设计你的循环队列实现。 循环队列是一种线性数据结构,其操作表现基于 FIFO(先进先出)原则并且队尾被连接在队首之后以形成一个循环。它也被称为“环形缓冲器”。 循环队列的一个好处是我们可以利用这个队列之前用过的空间... 阅读全文
posted @ 2019-03-05 14:29 落花流水Zxxxx 阅读(1026) 评论(0) 推荐(0)
摘要:#region Algorithm static void SelectionSorter()//选择排序 { int[] list = new int[] { 9, 5, 6, 89, 2, 0, 12, 895, 1, 6 }; for (int i = 0; i = x) ... 阅读全文
posted @ 2017-08-20 16:45 落花流水Zxxxx 阅读(188) 评论(0) 推荐(0)

1