Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?先分成大小相同(可能长度差1) 两部分, reverse一个list. ...
分类:
其他 时间:
2015-12-20 08:11:27
收藏:
0 评论:
0 赞:
0 阅读:
215
题目:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After r...
分类:
其他 时间:
2015-12-20 08:11:17
收藏:
0 评论:
0 赞:
0 阅读:
152
出现错误:error: 'for' loop initial declarations are only allowed in C99 modenote: use option -std=c99 or -std=gun99 to comple your code 原因:所采用的代码格式是C99...
分类:
其他 时间:
2015-12-20 08:10:47
收藏:
0 评论:
0 赞:
0 阅读:
199
题目:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w...
分类:
其他 时间:
2015-12-20 08:10:37
收藏:
0 评论:
0 赞:
0 阅读:
186
全文包括三部分:第一部分第二部分第三部分在本系列的第一部分,我介绍了企业级 OpenStack 的六大需求。现在,我会着重阐述接下来的两个主要需求:开放架构和混合云兼容性。让我们马上开始吧。需求3 -开放架构和减少厂商锁定 我们已经讨论过构造健壮的云控制平面和云管理系统。OpenStack 吸引人的...
分类:
其他 时间:
2015-12-20 08:10:27
收藏:
0 评论:
0 赞:
0 阅读:
295
题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=33451【思路】 最大流。 大体思路是枚举每个队伍,最大流判断是否可能成为冠军。 构图: 1 建立ST,比赛(u,v)建立n^2个结点,队伍u建立n个结点。 2 由S向...
分类:
其他 时间:
2015-12-20 08:10:17
收藏:
0 评论:
0 赞:
0 阅读:
157
题目:
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turni...
分类:
其他 时间:
2015-12-20 07:07:50
收藏:
0 评论:
0 赞:
0 阅读:
363
题目:For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible ro...
分类:
其他 时间:
2015-12-20 07:06:37
收藏:
0 评论:
0 赞:
0 阅读:
1652
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6...
分类:
其他 时间:
2015-12-20 07:04:07
收藏:
0 评论:
0 赞:
0 阅读:
164
题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet...
分类:
其他 时间:
2015-12-20 07:03:47
收藏:
0 评论:
0 赞:
0 阅读:
3520
Given an integer, write a function to determine if it is a power of two.还是有一个地方不小心:Integer.MIN_VALUE, 应该是false,但是因为只有一个1,我曾经判断为true。事实上,所有negative val...
分类:
其他 时间:
2015-12-20 07:03:27
收藏:
0 评论:
0 赞:
0 阅读:
169
程序员必知之浮点数运算原理详解 导读:浮点数运算是一个非常有技术含量的话题,不太容易掌握。许多程序员都不清楚使用==操作符比较float/double类型的话到底出现什么问题。 许多人使用float/double进行货币计算时经常会犯错。这篇文章是这一系列中的精华,所有的软件开发人员都应该读一下。....
分类:
其他 时间:
2015-12-20 07:02:27
收藏:
0 评论:
0 赞:
0 阅读:
559
Given an integer array of size n, find all elements that appear more than ? n/3 ? times. The algorithm should run in linear time and in O(1) space.Hin...
分类:
其他 时间:
2015-12-20 07:02:17
收藏:
0 评论:
0 赞:
0 阅读:
199
Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o...
分类:
其他 时间:
2015-12-20 07:01:51
收藏:
0 评论:
0 赞:
0 阅读:
249
题意:给出一个轮子,上面有一个随着它转动的传感器在圆周上,给出一个指定距离m,和轮子向前行进的速度v以及轮子的半径r。问让传感器通过该距离最少需要多少时间。分析:首先我们列出传感器行进距离与时间的轮子行进距离的关系:f(c) = c+r*sin(c/r)。其中c是距离,r是半径。该公式表示传感器从轮...
分类:
其他 时间:
2015-12-20 07:01:27
收藏:
0 评论:
0 赞:
0 阅读:
3708
犯过很多次这样的错误,不止被一次提醒,好丢人,相信不止我自己有这种错误吧,,,你们写过类似这样的代码吗:
int array[] = {4,3,2,1};
for( int i=0; i<array.length; i++ ){
System.out.println(array[i]);
}
?
?昨天又再一次被“提醒”。。。。上面的代码应该这 ...
分类:
其他 时间:
2015-12-20 02:17:27
收藏:
0 评论:
0 赞:
0 阅读:
235
html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-T ...
分类:
其他 时间:
2015-12-20 02:16:37
收藏:
0 评论:
0 赞:
0 阅读:
271
背景:
已有web应用a,b,c等,分别需要单独登录,现在需要以应用a的session为准,在a上登录和退出,应用a负责维持session,在b和c上有了操作也视为在应用a上有了操作。
?
分析:
在应用a,b,c上再搭建一
分类:
其他 时间:
2015-12-20 02:16:12
收藏:
0 评论:
0 赞:
0 阅读:
212
继百度、Bing之后,今天谷歌官方也发布了2015年的热搜榜单排行榜,用热词呈现今年人们最关心的热点事件和社会潮流。本年谷歌并没有针对中国地区发 ...
分类:
其他 时间:
2015-12-20 02:14:57
收藏:
0 评论:
0 赞:
0 阅读:
271
编写不易,转载请注明(http://shihlei.iteye.com/blog/2265159)
?
使用Eclipse 创建项目,Share 到 Git 仓库,并推送到GitHub 中
?
EGit 基本使用可参见《EGit(Git Eclipse Plugin)使用》
Eclipse:Luna Service Release 2 (4.4.2)
EGit:Eclipse ...
分类:
其他 时间:
2015-12-20 02:14:07
收藏:
0 评论:
0 赞:
0 阅读:
302