You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ...
分类:
其他好文 时间:
2014-10-05 23:28:39
阅读次数:
357
填充所有的结点如果存在右侧的节点,则指上(next)右节点;如果没有右侧的节点,那么就指上NULL,最初都指上NULL。
提示:只能使用给定的空间,并且你可以认为给定的二叉树是一个完美的二叉树。...
分类:
其他好文 时间:
2014-10-05 21:52:19
阅读次数:
145
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
Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such possibl...
分类:
其他好文 时间:
2014-10-05 17:44:58
阅读次数:
201
Silver Cow Party
Time Limit: 2000MS Memory Limit: 65536K
Total Submissions: 13020 Accepted: 5832
Description
One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to ...
分类:
其他好文 时间:
2014-10-05 09:37:48
阅读次数:
241
You are given a list of cities. Each direct connection between two cities has its transportation cost (an integer bigger than 0). The goal is to find the paths of minimum cost between pairs of cities....
分类:
Web程序 时间:
2014-10-05 01:29:57
阅读次数:
289
Problem Description
Everyone knows Matt enjoys playing games very much. Now, he is playing such a game. There are N rooms, each with one door. There are some keys(could be none) in each room corres...
分类:
其他好文 时间:
2014-10-04 20:38:27
阅读次数:
234
11464 - Even Parity
Time limit: 3.000 seconds
We have a grid of size N x N. Each cell of the grid initially contains a zero(0) or a one(1).
The parity of a cell is the number of 1s surrounding...
分类:
其他好文 时间:
2014-10-04 13:04:46
阅读次数:
155
介绍这篇文章的目的是为了介绍std::vector,怎样恰当地使用它们的成员函数等操作。本文中还讨论了条件函数和函数指针在迭代算法中使用,如在remove_if()和for_each()中的使用。通过阅读这篇文章读者应该可以有效地使用vector容器,并且应该不会再去使用C类型的动态数组了。Vect...
分类:
其他好文 时间:
2014-10-04 12:21:46
阅读次数:
238
var street = '清华园路';$('#streetid option:contains(' + street + ')').each(function(){ if ($(this).text() == street) { $(this).attr('selected', true); }}...
分类:
Web程序 时间:
2014-10-04 11:35:46
阅读次数:
257