Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.
For example,
Given 1->1->2, return 1->2.
Given 1->1->2->3->3, return 1->2->3.
很简单,先判断第一个位置否为空,不为空的话再判断下 个位置是否为空,如果都为空那么就不用操作了。
如果两...
分类:
其他好文 时间:
2014-10-05 20:16:08
阅读次数:
202
merge原型:std::mergedefault (1)template OutputIterator merge (InputIterator1 first1, InputIterator1 last1, InputIterator2 first...
分类:
其他好文 时间:
2014-10-05 18:57:28
阅读次数:
140
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord...
分类:
其他好文 时间:
2014-10-05 17:36:28
阅读次数:
213
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initial...
分类:
其他好文 时间:
2014-10-05 13:53:58
阅读次数:
163
Reduce计算分为若干阶段1. copy(或者叫shuffle)阶段和merge阶段并行之前Map产生的结果被存放在本地磁盘上,这时需要从reduce节点将数据从map节点复制过来。放得下进内存,比较大的则写到本地磁盘。同时,有两个线程对已经获得的内存中和磁盘上的数据进行merge操作。具体细节是:通过RPC调用询问task tracker已经完成的map task列表,shuffle(洗牌)是...
分类:
其他好文 时间:
2014-10-04 15:41:56
阅读次数:
240
hibernate的保存
hibernate对于对象的保存提供了太多的方法,他们之间有很多不同,这里细说一下,以便区别:
一、预备知识:
在所有之前,说明一下,对于hibernate,它的对象有三种状态,transient、persistent、detached
下边是常见的翻译办法:
transient:瞬态或者自由态
persistent:持久化状态
detache...
分类:
系统相关 时间:
2014-10-04 13:06:06
阅读次数:
314
原文转自:http://blog.jobbole.com/51786/在Airbnb,这几年我们已经学习了很多了关于构建富应用的经验,从2011年通过做我们的网站手机版,我们开始研究single-page应用,尤其是在我们正式推出Wish Lists和我们重新设计的search page以后。大部分...
分类:
编程语言 时间:
2014-10-04 09:56:26
阅读次数:
321
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* Lis...
分类:
其他好文 时间:
2014-10-03 17:21:45
阅读次数:
167
Problem Description
In this problem, you are given a string s and q queries.
For each query, you should answer that when all distinct substrings of string s were sorted lexicographically, which ...
分类:
其他好文 时间:
2014-10-03 16:56:54
阅读次数:
249
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* ...
分类:
其他好文 时间:
2014-10-03 15:40:04
阅读次数:
186