码迷,mamicode.com
首页 >  
搜索关键字:lintcode    ( 1584个结果
LintCode "Search a 2D Matrix II"
Simply a revise of a genius Greedy algorithm seen on LeetCode - linear walking.class Solution {public: /** * @param matrix: A list of lists of ...
分类:其他好文   时间:2015-09-23 06:46:28    阅读次数:199
LintCode "Sort Letters by Case"
A typical swapping.class Solution {public: /** * @param chars: The letters array you should sort. */ bool isUpper(char c) { r...
分类:其他好文   时间:2015-09-22 14:17:34    阅读次数:156
LintCode "Sort Colors II"
A variation to Sort Colors I - we take care of 2 sides, recursively\iteratively.class Solution{public: /** * @param colors: A list of integer ...
分类:其他好文   时间:2015-09-20 16:05:42    阅读次数:316
lintcode——排序列表转换为二分查找树(链表,二叉排序树)
中等排序列表转换为二分查找树查看运行结果27%通过给出一个所有元素以升序排序的单链表,将它转换成一棵高度平衡的二分查找树您在真实的面试中是否遇到过这个题?Yes样例标签Expand相关题目Expand思路:这道题将排好序的链表转化为二叉排序树,即左子树val);12 ret...
分类:编程语言   时间:2015-09-18 18:07:23    阅读次数:247
LintCode "Update Bits"
class Solution {public: /** *@param n, m: Two integer *@param i, j: Two bit positions *return: An integer */ int updateBits(int ...
分类:其他好文   时间:2015-09-18 15:24:44    阅读次数:194
LintCode "Longest Increasing Subsequence"
O(nlgn) with repeated numbers.. Please note the extra repeat count array:class Solution {public: /** * @param nums: The integer array * @re...
分类:其他好文   时间:2015-09-18 07:04:44    阅读次数:199
Lintcode Fibonacci
Find the Nth number in Fibonacci sequence. A Fibonacci sequence is defined as follow: The first two numbers are 0 and 1. The i th number is the sum of...
分类:其他好文   时间:2015-09-17 13:11:33    阅读次数:176
LintCode "Backpack"
A simple variation to 0-1 Knapsack.class Solution {public: /** * @param m: An integer m denotes the size of a backpack * @param A: Given n it...
分类:其他好文   时间:2015-09-15 12:27:12    阅读次数:133
LintCode "Median"
Partial Sort.class Solution {public: /** * @param nums: A list of integers. * @return: An integer denotes the middle number of the array. ...
分类:其他好文   时间:2015-09-15 07:00:36    阅读次数:134
LintCode "Subtree"
A variation to Binary Tree iteration.class Solution { bool isSame(TreeNode *p1, TreeNode *p2) { if (!p1 && !p2) return true; if( (...
分类:其他好文   时间:2015-09-13 14:40:02    阅读次数:300
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!