码迷,mamicode.com
首页 >  
搜索关键字:lintcode    ( 1584个结果
K个最近的点
前段时间在网上看到一些准备找工作的人会在LintCode上刷题,然后我今天上去看了一下,也打算开始做题,然后把每天做的题目和以后的优化记录下来。 2017年8月6日 21:17:27 第一题: 描述:给定一些 points 和一个 origin,从 points 中找到 k 个离 origin 最近 ...
分类:其他好文   时间:2017-08-06 23:10:00    阅读次数:238
k Sum II
Given n unique integers, number k (1> kSumII(int[] A, int k, int target) { // write your code here ArrayList> ans = new ArrayList(); ArrayList list = ... ...
分类:其他好文   时间:2017-08-06 14:02:45    阅读次数:154
Longest Common Substring
区别于 Longest Common Subsequence 这是累加求subString 的 状态设为遍历到当前的i, j时的结果值, 但是却是不对, 是因为求得是累加的值, Input "www.lintcode.com code", "www.ninechapter.com code" "ww ...
分类:其他好文   时间:2017-08-06 13:57:33    阅读次数:162
LintCode - Merge Two Sorted List
LintCode - Merge Two Sorted Lists LintCode - Merge Two Sorted Lists Web Link Description Code - C Tips Web Link http://www.lintcode.com/en/problem/mer ...
分类:其他好文   时间:2017-08-01 20:51:43    阅读次数:154
Lintcode: Nuts & Bolts Problem
其实是一种特别顺序的排序, 所以就用quicksort-partition, 不过比较的元素和设计互相patition, partition 的比较因为是有equals的, 所以得用三个指针遍历 考点: partition 的设计, pivot 的选择 , 另一方的排序通过nuts排好后的数组再排, ...
分类:其他好文   时间:2017-07-29 20:21:53    阅读次数:102
Java基础 矩阵面积
提供 数据结构与算法题目 的平台是LintCode,参考链接是:http://www.lintcode.com/zh-cn/ 问题描述: 参考代码: 结果与评价: ...
分类:编程语言   时间:2017-07-27 15:47:57    阅读次数:171
Lintcode-Max Tree
为啥用栈, 数组相对顺序不能变, 要找第一个比当前元素小的元素, 或大的元素, 同84. Largest Rectangle in Histogram 同84. Largest Rectangle in Histogram 在数组后面加"0", 这些操作都是为了遍历所有的元素, 有的不需要遍历所有的 ...
分类:其他好文   时间:2017-07-26 23:39:47    阅读次数:201
LintCode 刷题记录
1. A + B 问题:给出两个整数a和b, 求他们的和, 但不能使用 + 等数学运算符。 思路:使用^来求当前位置上的值,用&来求每个位置上的进位,进位向前移动一位后继续循环,直到进位为0。 class Solution { public: /* * @param a: The first int ...
分类:其他好文   时间:2017-07-23 16:38:35    阅读次数:194
算法:堆排序
堆排序可归纳为两个操作: 1)建堆:根据初始数组去构造初始堆(构建一个完全二叉树,保证所有的父结点都比它的孩子结点数值大)。 2)调整堆:每次交换第一个和最后一个元素,输出最后一个元素(最大值),然后把剩下元素重新调整为大根堆。 当输出完最后一个元素后,这个数组已经是按照从小到大的顺序排列了。调整堆 ...
分类:编程语言   时间:2017-07-21 21:52:57    阅读次数:199
[LintCode] Find the Missing Number II
Giving a string with number from 1 to n in random order, but miss 1 number.Find that number. You can assume n <= 30 Giving a string with number from 1 ...
分类:其他好文   时间:2017-07-21 15:39:33    阅读次数:173
1584条   上一页 1 ... 41 42 43 44 45 ... 159 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!