题目:
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?翻译:
给定一个下标k,返回第...
分类:
其他好文 时间:
2016-03-22 15:06:03
阅读次数:
172
splay模板题,都快把我做忧郁了。 由于自己调两个坑点。 1.删除时及时updata 2.Kth 考虑k满足该点的条件即r->ch[1]->size+1<=k && r->ch[1]->size+r->num>=k OIER公司是一家大型专业化软件公司,有着数以万计的员工。作为一名出纳员,我的任务
分类:
其他好文 时间:
2016-03-21 21:34:49
阅读次数:
297
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
分类:
其他好文 时间:
2016-03-14 12:13:00
阅读次数:
134
题目是: 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
题目链接:https://leetcode.com/problems/kth-largest-element-in-an-array/
215. Kth Largest Element in an Array
My Submissions
Question
Total Accepted: 43442 Total
Submissions: 136063 D...
分类:
编程语言 时间:
2016-02-24 09:41:19
阅读次数:
279
Description: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid,
分类:
其他好文 时间:
2016-02-20 00:30:11
阅读次数:
179
The trivial way, O(m + n): Merge both arrays and the k-th smallest element could be accessed directly. Merging would require extra space of O(m+n). Th
分类:
其他好文 时间:
2016-02-08 04:53:47
阅读次数:
381
综合性很强的一道题目,结合manacher,后缀数组,哈希,RMQ,二分可解。基本思路是通过manacher可以找到所有可能的回文串,哈希去重,后缀数组二分找数目。最后暴力求解。需要注意kth需要为__int64。 1 /* 4426 */ 2 #include <iostream> 3 #incl
分类:
其他好文 时间:
2016-02-05 01:49:59
阅读次数:
177
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 exam
分类:
其他好文 时间:
2016-01-31 09:35:56
阅读次数:
179
题目: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ B
分类:
其他好文 时间:
2016-01-29 16:05:13
阅读次数:
141