题目:
Implement an algorithm to find the nth to last element of a singly linked list.
翻译:
设计算法,从一个单链表中找到倒数第n个元素。
思路:
由于是单链表,我们只能从个前面遍历。我们可以有以下三种思路:
1、先遍历整个链表,求得链表的长度len,而后再从头遍历,找到地len-n(假设链表的首节点为第一个节点)个节点,即为导数第n个节点,这样时间复杂度为O(n),...
分类:
其他 时间:
2014-03-23 12:07:56
收藏:
0 评论:
0 赞:
0 阅读:
441
java密码MD5加密
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.apache.log4j.Logger;
/**
* 将密码进行MD5加密处理
*/
public class PassWordDigester...
分类:
编程语言 时间:
2014-03-23 11:10:43
收藏:
0 评论:
0 赞:
0 阅读:
501
Quartz Cron 表达式
一个cron 表达式是由6或者7个以空格分隔的字段组成。字段能够包含任何允许值,伴随着特殊字符不同组合。这些字段如下所示:
字段名称
是否一定需要
允许的值
允许的特殊字符串
Seconds
YES
0-59
, - * /
Minute...
分类:
其他 时间:
2014-03-23 11:01:09
收藏:
0 评论:
0 赞:
0 阅读:
548
题目
The set [1,2,3,…,n] contains a total of n!
unique permutations.
By listing and labeling all of the permutations in order,
We get the following sequence (ie, for n = 3):
"123""132""213...
分类:
其他 时间:
2014-03-23 11:46:59
收藏:
0 评论:
0 赞:
0 阅读:
433
POJ1988...
分类:
其他 时间:
2014-03-23 11:06:54
收藏:
0 评论:
0 赞:
0 阅读:
203
在《高质量程序设计指南(C/C++语言)》中,作者说:可以把程序的版式比喻为“书法”,好的“书法”可以让人对程序一目了然,看得兴致勃勃。确实,我们一打开程序,首先看到的便是程序的排版,我们的第一印象便是程序写得是工整还是凌乱。都说第一印象很重要,为了给大家留下好的第一印象,我们一定要注重程序的版式。
此外,好的注释能够帮助读者更快地理解程序,提高工作的效率。也许是因为工作比较忙的...
分类:
其他 时间:
2014-03-23 12:02:46
收藏:
0 评论:
0 赞:
0 阅读:
371
UE4从付费到下载到编译到运行的摘要。...
分类:
其他 时间:
2014-03-23 11:04:57
收藏:
0 评论:
0 赞:
0 阅读:
458
我在研究生二年级上学期的时候,被老师派到一个国家的863项目开发小组,参与到OLSR协议的二次开发。
我个人认为自己的项目开发经验比较多,在参与到这个小组项目之前,我做过PHP、C#、MFC、python、Mysql开发,基本上涉及到各种模型的开发,B/S和C/S,网络通信等。
但是从这个863项目,我基本上否定了自己。
这个项目是在linux环境下的一个开源协议修改。我之前没怎么真...
分类:
其他 时间:
2014-03-23 11:54:20
收藏:
0 评论:
0 赞:
0 阅读:
368
首先要确保jdk和tomcat的安装,并且设置好环境变量。
1.找到sg-uap的安装执行文件,双击安装
2.把sguap-server文件夹拷贝到tomcat的发布目录,即webapps下
3.把授权码(license.dat、pw.key)拷贝到webapps\sguap-server\WEB-INF\_srv文件夹下
4.运行tomcat和uap,打开Window/Preferenc...
分类:
其他 时间:
2014-03-23 12:11:11
收藏:
0 评论:
0 赞:
0 阅读:
492
1005. Spell It Right (20)
PAT
Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English....
分类:
其他 时间:
2014-03-23 11:49:08
收藏:
0 评论:
0 赞:
0 阅读:
238
微软提供的发送邮件类的应用 和 MD5加密算法...
分类:
其他 时间:
2014-03-23 11:03:03
收藏:
0 评论:
0 赞:
0 阅读:
445
题目
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
You...
分类:
其他 时间:
2014-03-23 11:42:44
收藏:
0 评论:
0 赞:
0 阅读:
396
jquery中focus()函数实现当对象获得焦点后自动把光标移到内容最后
//获取焦点后光标在字符串后
//其原理就是获得焦点后重新把自己复制粘帖一下
var t=$("#"+id).val();
$("#"+id).val("").focus().val(t);...
分类:
Web开发 时间:
2014-03-23 11:41:36
收藏:
0 评论:
0 赞:
0 阅读:
396
题目地址:点击打开链接
就是简单的BFS就可以了
C++代码:
#include
#include
#include
using namespace std;
const int maxsize = 210;
int n;
int graph[maxsize][maxsize];
int visieted[maxsize];
bool flag;
void bfs()
{
visie...
分类:
其他 时间:
2014-03-23 11:53:15
收藏:
0 评论:
0 赞:
0 阅读:
486
Android的自定义notification选项我觉得限制还是挺多的,如图所示,官方API告诉我们它依然必须得设置icon,tittle,text三个选项,除此之外,还一定要设置pengdingintent,不少网友还反映 builder.setContent(remoteViews)后面一定要紧跟着builder.setContentIntent(pendingIntent),要不然会报错误:android.app.RemoteServiceException: Bad notification pos...
分类:
移动平台 时间:
2014-03-23 12:10:04
收藏:
0 评论:
0 赞:
0 阅读:
611
1 新建空解决方案WCFServiceExp。
在解决方案下面新建Windows应用程序WCFClient和WCF服务应用程序WCFService。
程序完工后的结构如下图所示。
2 实现WCFService
新建WCF服务应用程序WCFService
在解决方案上右击--选择“添加”--选择“新建项目”--在已安装的模板中选择“WCF”--选择“WCF服务应用程序”
...
分类:
其他 时间:
2014-03-23 12:09:01
收藏:
0 评论:
0 赞:
0 阅读:
528
STL经典总结.......
分类:
其他 时间:
2014-03-23 11:04:02
收藏:
0 评论:
0 赞:
0 阅读:
567
题意:给出一个环 环上的每个点有一个值 点和点之间用一条边相连,边上有一个运算符,要求删除一条边,然后对剩下的线两两顶点合并运算.求通过运算能得到的最大值.并求出删除某条边后能经过运算得到这个最大值的这些边.
由于N
要注意的是最大值可能有最小值相乘得到(负数),所以也要记录最小值.
设dp1[i][j]为从i到j的最大运算结果,dp2为最小值
那么
dp1[i][j] = max(dp...
分类:
其他 时间:
2014-03-23 11:09:48
收藏:
0 评论:
0 赞:
0 阅读:
395
1. 插上手机打开终端,输入:system_profiler SPUSBDataType,将输出结果记住。
2. 拔下手机,重复以上动作。
两者结果对比后会获得一个Vendor ID:
Composite Device:
Product ID: 0x0010
Vendor ID: 0x2207 (Fuzhou Rockchip El...
分类:
移动平台 时间:
2014-03-23 11:08:50
收藏:
0 评论:
0 赞:
0 阅读:
588
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 removing the second node from the end, the...
分类:
其他 时间:
2014-03-23 11:56:30
收藏:
0 评论:
0 赞:
0 阅读:
395