![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode中级
mouthful
两分钟理论
展开
-
leetcode-中级-中序遍历
援引自:https://blog.csdn.net/jsh0123/article/details/50624930 非递归算法: int* inorderTraversal(struct TreeNode* root, int* returnSize) { struct TreeNode** stack=NULL,*pre=root; *returnSize=0; ...转载 2018-07-22 02:49:38 · 98 阅读 · 0 评论 -
leetcode- 数组中的第K个最大元素
在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。 示例 1: 输入: [3,2,1,5,6,4] 和 k = 2 输出: 5 示例 2: 输入: [3,2,3,1,2,4,5,5,6] 和 k = 4 输出: 4 说明: 你可以假设 k 总是有效的,且 1 ≤ k ≤ 数组的长度。 快排解决这个问题。 ...原创 2018-07-22 04:30:41 · 341 阅读 · 0 评论 -
三数之和
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not c...翻译 2018-08-19 12:10:22 · 199 阅读 · 0 评论 -
两数相加
两数相加 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 and ...原创 2018-08-19 19:45:43 · 79 阅读 · 0 评论