码迷,mamicode.com
首页 >  
搜索关键字:leetcode 19    ( 34993个结果
Leetcode: 632. Smallest Range Covering Elements from K Lists
Description You have k lists of sorted integers in ascending order. Find the smallest range that includes at least one number from each of the k lists ...
分类:其他好文   时间:2020-07-19 15:47:40    阅读次数:73
LeetCode 102. 二叉树的层序遍历
给你一个二叉树,请你返回其按 层序遍历 得到的节点值。 (即逐层地,从左到右访问所有节点)。 示例: 二叉树:[3,9,20,null,null,15,7], 3 / \ 9 20 / \ 15 7 返回其层次遍历结果: [ [3], [9,20], [15,7] ] class Solution( ...
分类:其他好文   时间:2020-07-19 13:49:57    阅读次数:77
LeetCode 94.二叉树的中序遍历
给定一个二叉树,返回它的中序 遍历。 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [1,3,2] 进阶: 递归算法很简单,你可以通过迭代算法完成吗? ## 迭代 class Solution: def inorderTraversal(self, root: TreeNod ...
分类:其他好文   时间:2020-07-19 11:38:09    阅读次数:55
leetcode-----99. 恢复二叉搜索树
链接:https://leetcode-cn.com/problems/recover-binary-search-tree/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode ...
分类:其他好文   时间:2020-07-19 11:36:41    阅读次数:70
leetcode-----100. 相同的树
链接:https://leetcode-cn.com/problems/same-tree/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
分类:其他好文   时间:2020-07-19 11:33:58    阅读次数:44
LeetCode刷题 -- 97. 交错字符串
今天这道题是困难难度的,二狗很努力的尝试,还是失败了。但是感觉虽然没通过全部的测试用例,思考的过程还是有很多地方挺有趣的,记录一下。 97. 交错字符串 给定三个字符串 s1, s2, s3, 验证 s3 是否是由 s1 和 s2 交错组成的。 示例 1: 输入: s1 = "aabcc", s2 ...
分类:其他好文   时间:2020-07-19 00:59:58    阅读次数:95
搜索插入位置
此博客链接: https://www.cnblogs.com/ping2yingshi/p/13337999.html 搜索插入位置 题目链接:https://leetcode-cn.com/problems/search-insert-position/submissions/ 给定一个排序数组和 ...
分类:其他好文   时间:2020-07-19 00:56:40    阅读次数:101
1060. Missing Element in Sorted Array
package LeetCode_1060 /** * 1060. Missing Element in Sorted Array * (Prime) * Given a sorted array A of unique numbers, find the K-th missing number s ...
分类:其他好文   时间:2020-07-19 00:49:27    阅读次数:93
1507. Reformat Date
package LeetCode_1507 import java.lang.StringBuilder /** * 1507. Reformat Date * https://leetcode.com/problems/reformat-date/description/ * * Given a ...
分类:其他好文   时间:2020-07-19 00:30:33    阅读次数:69
LeetCode 树 98. 验证二叉搜索树(二叉搜索树,递归,中序遍历,迭代)
中序。 刚拿到题目时,第一想法是递归,但是搞错了二叉搜索树成立的条件。 我以为的条件是:左侧树为二叉搜索树,右侧树为二叉搜索树,且root.right>root>root.left,然后递归。 但是显然这不对,满足以上条件后,root.right.left可能比root要小。 先说正确的递归解法:正 ...
分类:其他好文   时间:2020-07-18 22:03:27    阅读次数:71
34993条   上一页 1 ... 95 96 97 98 99 ... 3500 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!