码迷,mamicode.com
首页 >  
搜索关键字:kth    ( 692个结果
Leetcode[119]-Pascal's Triangle II
Given an index k, return the kth row of the Pascal’s triangle.For example, given k = 3, Return [1,3,3,1].Note: Could you optimize your algorithm to use only O(k) extra space?分析:通过递归设置vector的值,变量i表示当前...
分类:其他好文   时间:2015-06-09 13:51:09    阅读次数:96
Leetcode题解(3):L215/Kth Largest Element in an Array
L215: 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.For example,   Gi...
分类:其他好文   时间:2015-06-07 09:40:21    阅读次数:113
LeetCode 119:Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. 题目要求计算杨辉三角某一行的元素,这个也是二项式系数的计算问题。 class Solution { public: vector getRow(int row...
分类:其他好文   时间:2015-06-06 09:08:37    阅读次数:114
Kth Largest Element in an Array
Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl...
分类:其他好文   时间:2015-06-05 22:23:05    阅读次数:118
[LeetCode] Kth Largest Element in an Array
Well, this problem has a naive solution, which is to sort the array in descending order and return thek-1-th element. However, sorting algorithm gives...
分类:其他好文   时间:2015-06-03 00:38:52    阅读次数:230
Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]....
分类:其他好文   时间:2015-06-02 23:30:17    阅读次数:153
[215]Kth Largest Element in an Array
public class Solution { public int findKthLargest(int[] nums, int k) { return find(nums,nums.length-k,0,nums.length-1); } public int f...
分类:其他好文   时间:2015-05-31 18:09:20    阅读次数:110
[LeetCode] Kth Largest Element in an Array 数组中第k大的数字
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.For examp...
分类:编程语言   时间:2015-05-30 07:05:25    阅读次数:251
LeetCode Pascal's Triangle II
Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you optimize your algorithm to use only O(k) extra space? 题意:和上一题差别在于只能用...
分类:其他好文   时间:2015-05-29 12:07:02    阅读次数:124
leetcode 215: Kth Largest Element in an Array
leetcode 215: Kth Largest Element in an Array...
分类:其他好文   时间:2015-05-29 09:57:36    阅读次数:103
692条   上一页 1 ... 58 59 60 61 62 ... 70 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!