码迷,mamicode.com
首页 >  
搜索关键字:kth largest    ( 1961个结果
字符串中第二大的数
此博客链接: 字符串中第二大的数 题目链接:https://leetcode-cn.com/problems/second-largest-digit-in-a-string/ 题目 给你一个混合字符串 s ,请你返回 s 中 第二大 的数字,如果不存在第二大的数字,请你返回 -1 。 混合字符串 ...
分类:其他好文   时间:2021-04-14 12:31:36    阅读次数:0
【Leetcode】排序相关
【Leetcode-215】 一、题目:数组中的第k大元素 在未排序的数组中找到第 k 个最大的元素。请注意,你需要找的是数组排序后的第 k 个最大的元素,而不是第 k 个不同的元素。 二、代码: def findKthLargest(self, nums: List[int], k: int) - ...
分类:编程语言   时间:2021-04-02 13:24:48    阅读次数:0
第k小的结点
给定一棵二叉搜索树,请找出其中的第k小的结点。例如, (5,3,7,2,4,6,8) 中,按结点数值大小顺序第三小结点的值为4。 重点是,如何管理kk的值与最终结果的关系。 /* struct TreeNode { int val; struct TreeNode *left; struct Tre ...
分类:其他好文   时间:2021-02-09 12:14:08    阅读次数:0
LeetCode | 0230. 二叉搜索树中第K小的元素【Python】
Problem LeetCode Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Example 1: Input: root = [3,1,4,null ...
分类:编程语言   时间:2021-01-11 10:45:32    阅读次数:0
GISOO通信
GISOO通信-- https://github.com/araujokth/kth-gisoo/wiki/Installing-GISOO 简介 GISOO代表Simulink和COOja的图形集成,并且名称代表GISOO中的每个模拟应该包括两个模拟的组合,一个在Cooja中,另一个在Simuli ...
分类:其他好文   时间:2021-01-05 11:31:55    阅读次数:0
0084. Largest Rectangle in Histogram (H)
Largest Rectangle in Histogram (H) 题目 Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the ...
分类:其他好文   时间:2021-01-05 10:40:12    阅读次数:0
@Data 注解引出的 lombok
今天在看代码的时候, 看到了这个注解, 之前都没有见过, 所以就查了下, 发现还是个不错的注解, 可以让代码更加简洁. 这个注解来自于 lombok,lombok 能够减少大量的模板代码,减少了在使用@Data 注解时, 需要导入lombok.Data,下面列举下 lombok提供的注解: val ...
分类:其他好文   时间:2020-12-31 11:52:51    阅读次数:0
215. 数组中的第K个最大元素
题目链接:https://leetcode-cn.com/problems/kth-largest-element-in-an-array/ 1 先快速排序,再取第 K个 class Solution { public int findKthLargest(int[] nums, int k) { ...
分类:编程语言   时间:2020-12-19 12:57:18    阅读次数:1
ProjectEuler
按照题号排序 1.Multiples of 3 and 5 题意:求 $1000$ 以内的,是 $3$ 或 $5$ 倍数的数的和 直接模拟 2.Even Fibonacci numbers 题意:求 $4\times 10 ^ 6$ 内的,是偶数的斐波那契数之和 直接模拟 3.Largest pri ...
分类:其他好文   时间:2020-11-24 12:11:58    阅读次数:5
PAT(Advanced Level)A1094. The Largest Generation
题意 树的层序遍历的问题,找到结点数最多的一层,输出结点树和对应层号 思路 看到是树层序遍历就立马反应过来用BFS做,可以说是裸模版的题目了 层序遍历在每次扩展状态的时候都是取一层的结点数进行扩展,此时就可以直接比较来找题目要求的解了 代码 #include <algorithm> #include ...
分类:其他好文   时间:2020-10-05 21:55:34    阅读次数:27
1961条   上一页 1 2 3 4 ... 197 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!