码迷,mamicode.com
首页 >  
搜索关键字:kth    ( 692个结果
BZOJ_3224_普通平衡树(Treap)
描述 Treap模板题.支持如下几种操作: 1.插入; 2.删除; 3.rank(x); 4.kth(k); 5.pre(x); 6.suc(x); 分析 写多了就熟了...昨天看了书,今天调试的时候敲了好多遍,感觉满脑子是tree+heap. p.s. 1.rank,kth,pre,suc函数都可 ...
分类:其他好文   时间:2016-05-11 23:19:23    阅读次数:152
118. 119. Pascal's Triangle -- 杨辉三角形
118. Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 119. Given an index k, return the kth row o ...
分类:其他好文   时间:2016-05-01 11:03:08    阅读次数:184
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]. Pascal's Triangle为给出行数,求所有结果,这题是给出任意行号,求该行的结 ...
分类:其他好文   时间:2016-04-30 16:53:14    阅读次数:239
Kth Largest Element in an Array
利用最小堆解决,代码如下: ...
分类:其他好文   时间:2016-04-24 12:48:13    阅读次数:192
Leetcode 230 Kth Smallest Element in a BST
1. 问题描写叙述 给定一个二叉搜索树,找出第k小的元素。 注意:能够如果k总是存在,1≤k≤BST总元素数1 \le k \le BST总元素数。 2. 方法与思路 依据二叉搜索树的特点。中序遍历的结果即是排序好的数组。那么找出第k小的数,仅仅须要先进行一次中序遍历就可以。 /** * Defin ...
分类:其他好文   时间:2016-04-17 20:44:37    阅读次数:148
HDU 2665 Kth number(划分树)
题目链接:点击打开链接 思路:划分树模板题。 细节参见代码: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define Max(a,b) ((a)>(b)?(a):(...
分类:其他好文   时间:2016-04-16 19:16:04    阅读次数:191
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 us ...
分类:其他好文   时间:2016-04-12 23:53:06    阅读次数:225
230. Kth Smallest Element in a BST
...
分类:其他好文   时间:2016-04-02 12:06:10    阅读次数:180
230. Kth Smallest Element in a BST
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 ≤ BST's ...
分类:其他好文   时间:2016-04-01 12:43:25    阅读次数:145
The kth great number_优先队列_priority
The kth great number TimeLimit: 2000/1000 MS (Java/Others) MemoryLimit: 65768/65768 K (Java/Others) TimeLimit: 2000/1000 MS (Java/Others) MemoryLimit: ...
分类:其他好文   时间:2016-03-27 15:17:35    阅读次数:264
692条   上一页 1 ... 44 45 46 47 48 ... 70 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!