https://oj.leetcode.com/problems/merge-k-sorted-lists/ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexi...
分类:
其他好文 时间:
2015-03-04 22:20:44
阅读次数:
141
[LeetCode] 021. Merge Two Sorted Lists (Easy) (C++/Python)...
分类:
编程语言 时间:
2015-03-04 21:09:52
阅读次数:
221
Search Insert Position问题:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be ...
分类:
其他好文 时间:
2015-03-04 16:15:16
阅读次数:
107
这题真是浪费了很多时间,想法也对了,转移到寻找第k小的元素上来,然后根据两个都是一排好序的数组,像类似算法导论中利用partition找到划分的q,但在这里,由于题目要求O(logn),所以这个找q的过程必须是常数时间,想了好久想不到一个常数时间的划分。最后在网上找到答案了:分析:我们现在设计一个求...
分类:
其他好文 时间:
2015-03-04 14:19:17
阅读次数:
93
sortBy:var collection = ['John', 'Petteri', 'Antti', 'Joonas', 'Zhentian'];var sorted = _.sortBy(collection);//[ 'Antti', 'John', 'Joonas', 'Petteri',...
分类:
编程语言 时间:
2015-03-04 06:13:41
阅读次数:
195
https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/Given a sorted linked list, delete all nodes that have duplicate numbers, leavi...
分类:
其他好文 时间:
2015-03-03 20:29:59
阅读次数:
174
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 水题,注意 du...
分类:
其他好文 时间:
2015-03-03 18:25:00
阅读次数:
112
https://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/Given a singly linked list where elements are sorted in ascending order, co...
分类:
其他好文 时间:
2015-03-03 14:57:08
阅读次数:
166
做完Find Minimum in Rotated Sorted Array I觉得很简单,再做2发现也不难,但是LeetCode竟然给了一个hard评级,难道是我编程水平大有长进?哈哈我估计是对复杂度有很高的要求的情况下比较难吧。。
Python(偷懒)做法就是一句话:return min(num)
Java(基本做法)如下:
public class Solution {
pub...
分类:
其他好文 时间:
2015-03-03 11:44:26
阅读次数:
128
Redis 数据类型分析 字符串 哈希 列表 集合 有序集合 优缺点 分析 注意事项 存储结构 字符串(Strings) 哈希(Hashes) 列表(Lists) 集合(Sets) 有序集合(Sorted sets) 512M 4294967295 4294967295 42949...
分类:
其他好文 时间:
2015-03-02 17:06:28
阅读次数:
174