码迷,mamicode.com
首页 >  
搜索关键字:kth largest    ( 1961个结果
如何理解"我们有成熟的时间复杂度为O(n)的算法得到数组中任意第k大的数"
在剑指offer第2版"面试题39:数组中出现次数超过一半的数字"的题解中,有这么一句话: "我们有成熟的时间复杂度为O(n)的算法得到数组中任意第k大的数字", 我觉得这句话有点不妥,至少让我产生过误解。 go代码如下: func partition(nums []int, l, r int) i ...
分类:编程语言   时间:2020-01-04 14:36:08    阅读次数:91
leetcode 215. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example ...
分类:其他好文   时间:2020-01-03 21:27:13    阅读次数:104
62.二叉搜索树的第k个节点(python)
题目描述 给定一棵二叉搜索树,请找出其中的第k小的结点。例如, (5,3,7,2,4,6,8) 中,按结点数值大小顺序第三小结点的值为4。 思路:中序遍历 1 class Solution: 2 # 返回对应节点TreeNode 3 def KthNode(self, pRoot, k): 4 # ...
分类:编程语言   时间:2019-12-31 23:10:27    阅读次数:62
[LC] 221. Maximal Square
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example: Input: 1 0 1 0 0 1 0 1 1 1 ...
分类:其他好文   时间:2019-12-27 13:47:34    阅读次数:76
# 第五章 服务:让客户端发现pod并与之通信 ##
1.什么是服务 2.创建服务 1.创建一个rc控制器,启动三个pod,暴露容器端口8080 2.创建一个服务 创建的服务会根据selector标签来选择pod,凡是pod标签和服务标签匹配的都属于同一个服务,上面服务会占用80端口,服务会将链接转发到容器的8080端口 3.检测新服务 4.检测服务是 ...
分类:其他好文   时间:2019-12-24 09:47:53    阅读次数:128
Boggle Game
Description Given a board which is a 2D matrix includes a-z and dictionary dict, find the largest collection of words on the board, the words can not ...
分类:其他好文   时间:2019-12-22 00:39:36    阅读次数:70
Maximum Product Subarray
Description Find the contiguous subarray within an array (containing at least one number) which has the largest product. Description Description Find ...
分类:其他好文   时间:2019-12-21 22:54:06    阅读次数:97
Maximal Square
Description Description Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. Example Exam ...
分类:其他好文   时间:2019-12-21 22:34:38    阅读次数:87
Maximal Square II
Description Description Given a 2D binary matrix filled with 0's and 1's, find the largest square which diagonal is all 1 and others is 0. Only consid ...
分类:其他好文   时间:2019-12-21 22:24:34    阅读次数:67
Maximum Subarray
Description Description Given an array of integers, find a contiguous subarray which has the largest sum. The subarray should contain at least one num ...
分类:其他好文   时间:2019-12-21 22:17:06    阅读次数:99
1961条   上一页 1 ... 13 14 15 16 17 ... 197 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!