其实做起来会感觉很简单,需要注意的是要考虑效率的问题,毕竟可能是很长的字符串数组,所以可以考虑选取所有字符串中最短的那个来首先进行比较,因为最长公共子串肯定不会大于其长度,这样避免了字符串之间长度差异很大造成的效率损失,然后每次比较之后最长公共子串的长度也永远不会大于最短的那个字符串,只会不变或相等,只要遍历字符串数组,挨个对比、更改最短公共字符串记录即可,code如下:...
分类:
其他好文 时间:
2014-06-11 06:58:55
阅读次数:
226
1.问题:Eclipse+Tomcat6,run到Tomcat6时报这个版本支持问题.2.原因:Tomcate6最多支持Servlet2.5的,但是现在的项目是3.0,所以要降低项目的版本3.解决在项目的根目录下有个.settings文件夹,找org.eclipse.wst.common.project.facet.core.xml文件.把<installedfacet="jst.web"v..
分类:
Web程序 时间:
2014-06-10 23:42:25
阅读次数:
823
1, 可能是因为c:\program files\common files\microsoft
Shared\web server
Extensions\40\bin目录下缺少Fp4autl.dll,Fpencode.dll和Fp4awel.dll这三个文件导致的.可以从 windows
xp的安装...
分类:
其他好文 时间:
2014-06-10 19:41:53
阅读次数:
188
自动安装oracle所需要的rpm包(需要访问外网):#!/bin/sh
rpmpack="
binutils
compat-libstdc++*
elfutils-libelf
elfutils-libelf-devel
elfutils-libelf-devel-static
gcc
gcc-c++
glibc
glibc-common
glibc-devel
glibc-headers
kernel-headers
ksh
libaio
libaio-devel
lib..
分类:
数据库 时间:
2014-06-10 18:46:44
阅读次数:
290
1. add maven commons-beanutils
commons-beanutils 1.9.2 compile 2. 参数赋值取值PropertyUtils.getSimpleProperty(Object,
String...
分类:
其他好文 时间:
2014-06-10 17:11:31
阅读次数:
283
1.准备工作jdk:eclipse:Maven:libprotoc
:https://developers.google.com/protocol-buffers/hadoop:http://www.apache.org/dyn/closer.cgi/hadoop/common/添加开源中国mave...
分类:
系统相关 时间:
2014-06-10 17:07:37
阅读次数:
356
原题地址:https://oj.leetcode.com/problems/longest-common-prefix/题意:Write
a function to find the longest common prefix string amongst an array of
strings.解...
分类:
编程语言 时间:
2014-06-10 16:31:52
阅读次数:
261
在工程目录上右键, 选properties, 弹出属性窗口, 选中Web Project
Settings, 在右边的Context
root中修改保存即可死马当做活马医在你的工程目录下找到.settings里面的org.eclipse.wst.common.component,修改它的deploy...
分类:
编程语言 时间:
2014-06-10 10:22:13
阅读次数:
250
戳我去解题Write a function to find the longest
common prefix string amongst an array of strings.class Solution {public: string
longestCommonPrefix(vecto...
分类:
其他好文 时间:
2014-06-10 08:29:55
阅读次数:
189
题目描述:
Write a function to find the longest common prefix string amongst an
array of strings.
很简单的一道题目,但是我写了两个不一样的版本,运行时间确实数倍之差。。贴代码如下:
版本1:
{CSDN:CODE:384511}
这个版本的运行时间为 44 ms...
分类:
其他好文 时间:
2014-06-10 08:18:58
阅读次数:
291