随笔分类 - 算法
1
摘要:一、问题 https://leetcode-cn.com/problems/move-zeroes/ 给定一个数组 nums,编写一个函数将所有 0 移动到数组的末尾,同时保持非零元素的相对顺序。 示例: 输入: [0,1,0,3,12] 输出: [1,3,12,0,0] 说明: 必须在原数组上操作
阅读全文
摘要:一、问题 https://leetcode-cn.com/problems/merge-two-sorted-lists/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MergeTwoListsClass.cs B
阅读全文
摘要:一、问题https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MaxDepthClass.cs B
阅读全文
摘要:一、问题 https://leetcode-cn.com/problems/invert-binary-tree/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/InvertTreeClass.cs Blog:htt
阅读全文
摘要:一、问题 https://leetcode-cn.com/problems/hamming-distance/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/HammingDistanceClass.cs Blog:
阅读全文
摘要:一、问题 https://leetcode-cn.com/problems/merge-two-binary-trees/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MergeClass.cs Blog:http
阅读全文
摘要:一、问题 https://leetcode-cn.com/problems/largest-sum-of-averages/solution/ 二、GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/Class813.cs B
阅读全文
摘要:问题:https://leetcode-cn.com/problems/detect-capital/submissions/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/Class520.cs Blog:https:
阅读全文
摘要:问题:https://leetcode-cn.com/problems/search-in-rotated-sorted-array/submissions/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/Class33
阅读全文
摘要:问题:https://leetcode-cn.com/problems/search-a-2d-matrix-ii/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/SearchMatrixClass.cs Blog:ht
阅读全文
摘要:问题:https://leetcode-cn.com/problems/majority-element/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/MajorityElementClass.cs Blog:http
阅读全文
摘要:问题:https://leetcode-cn.com/problems/single-number/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/SingleNumberClass.cs Blog:https://ww
阅读全文
摘要:问题:https://leetcode-cn.com/problems/number-of-islands/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/NumIslandsClass.cs Blog:https://
阅读全文
摘要:问题:https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/EvalRPNClass.cs B
阅读全文
摘要:问题:https://leetcode-cn.com/problems/daily-temperatures/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/DailyTemperaturesClass.cs Blog:
阅读全文
摘要:问题:https://leetcode-cn.com/problems/valid-parentheses/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/ValidParentheses.cs Blog:https:/
阅读全文
摘要:问题:https://leetcode-cn.com/problems/perfect-squares/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/blob/master/NumSquares.cs Blog:https://www.cnb
阅读全文
摘要:思路:使用先进先出的队列,广度优先搜索,使用字典可大幅减少遍历时间 问题:https://leetcode-cn.com/problems/open-the-lock/submissions/ GitHub实现:https://github.com/JonathanZxxxx/LeetCode/bl
阅读全文
摘要:一、代码实现循环队列思路:使用数组存储数据,两个指针保存队列头尾问题:https://leetcode-cn.com/problems/design-circular-queue/ 设计你的循环队列实现。 循环队列是一种线性数据结构,其操作表现基于 FIFO(先进先出)原则并且队尾被连接在队首之后以形成一个循环。它也被称为“环形缓冲器”。 循环队列的一个好处是我们可以利用这个队列之前用过的空间...
阅读全文
摘要:#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) ...
阅读全文
1

浙公网安备 33010602011771号