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.
思路:此题与上一题异曲同工,具体解法如下:
...
分类:
编程语言 时间:
2015-07-22 14:39:29
阅读次数:
99
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.
思路:此题的意思是给一个为0或1的矩阵,求全部为1组成的最大矩阵的面积。
此题可以巧妙转化为求最大直方图面积的问题。
public class S...
分类:
其他好文 时间:
2015-07-22 14:37:08
阅读次数:
98
\n是换行,英文是New line,表示使光标到行首 \r是回车,英文是Carriage return,表示使光标下移一格 \r\n表示回车换行 我们在平时使用电脑时,已经习惯了回车和换行一次搞定,敲一个回车键,即是回车,又是换行。...
分类:
其他好文 时间:
2015-07-22 13:27:03
阅读次数:
131
"/>"/>#工厂模式简易计算器abstractclassCore{abstractpublicfunctiongetValue($num1,$num2);}classJiaextendsCore{publicfunctiongetValue($num1,$num2){return$num1+$nu...
分类:
Web程序 时间:
2015-07-22 12:48:27
阅读次数:
125
我们有下面的测试代码: 1 #include 2 using namespace std; 3 4 5 int main() 6 { 7 int num1=7; 8 cout>2: ">2)>1: ">1)>2: ">2)<<endl;14 return 0;15 }对...
分类:
其他好文 时间:
2015-07-22 12:26:53
阅读次数:
147
先上代码吧:-(NSMutableArray *)totalPathPoints{
if (_totalPathPoints == nil) {
_totalPathPoints = [NSMutableArray array];
}return _totalPathPoints;
}
// Only override drawRect: if you perform...
分类:
其他好文 时间:
2015-07-22 10:54:41
阅读次数:
104
首先通过GNUstep上得源代码来叙述各个函数的实现(GNUstep是Cocoa框架的互换框架,二者的行为和实现方式非常相似)
GNUstep源代码中NSObject类的alloc方法:
id = obj = [NSObject alloc];
/**********************************/
+(id) alloc{
return [self...
分类:
其他好文 时间:
2015-07-22 10:52:52
阅读次数:
112
友情题目链接http://acm.hdu.edu.cn/showproblem.php?pid=2577
#include
#include
#include
using namespace std;
const int N=110;
char str[N];
int close[N],open[N];
int MIN(int a ,int b)
{
return a=a<b?a:b;
}
i...
分类:
其他好文 时间:
2015-07-22 10:49:33
阅读次数:
108
【019-Remove Nth Node From End of List(移除单链表的倒数第N个节点)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Given a linked list, remove the nth node from the end of list and return its head.
For example, Given lin...
分类:
编程语言 时间:
2015-07-22 09:30:15
阅读次数:
132
ajax.js(function(exports, document, undefined){ "use strict"; function Ajax(){ if(!(this instanceof Ajax)) return; return this; ...
分类:
编程语言 时间:
2015-07-22 09:20:09
阅读次数:
140