LeetCode: Copy List with Random PointerA linked list is given such that each node contains an additional random pointer which could point to any node ...
分类:
其他好文 时间:
2014-08-23 12:34:30
阅读次数:
193
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the sub...
分类:
其他好文 时间:
2014-08-23 11:22:40
阅读次数:
198
被第二个条件给坑了
You are giving candies to these children subjected to the following requirements:
Each child must have at least one candy.Children with a higher rating get more candies than their ne...
分类:
其他好文 时间:
2014-08-23 11:20:30
阅读次数:
173
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for...
分类:
其他好文 时间:
2014-08-23 11:14:10
阅读次数:
219
由于题目意思是满二叉树:所以,对当前节点,设置它的左右子节点的next指针即可root->left->next = root->rightroot->right->next = root->next?root->next->left:NULL 1 /** 2 * Definition for bi....
分类:
其他好文 时间:
2014-08-22 22:24:49
阅读次数:
233
同上题:但是这题需要考虑好对当前节点的left和right的next指针如何设置。 1 /** 2 * Definition for binary tree with next pointer. 3 * struct TreeLinkNode { 4 * int val; 5 * Tre...
分类:
其他好文 时间:
2014-08-22 22:23:59
阅读次数:
324
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, ...
分类:
其他好文 时间:
2014-08-22 22:18:59
阅读次数:
342
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist...
分类:
其他好文 时间:
2014-08-22 21:04:59
阅读次数:
168
首先引入js,内容如下: 1 (function($){$.fn.slides=function(option){option=$.extend({},$.fn.slides.option,option);return this.each(function(){$('.'+option.contai...
分类:
其他好文 时间:
2014-08-22 19:25:29
阅读次数:
220
Sum
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 10160
Accepted: 6674
Description
Consider the natural numbers from 1 to N. By associating to each num...
分类:
其他好文 时间:
2014-08-22 17:55:49
阅读次数:
179