上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 43 下一页
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.Notes:It is intended for this problem to be specified vaguely (ie, no given input specs). You are respo 阅读全文
posted @ 2013-06-27 10:29 feiling 阅读(223) 评论(0) 推荐(0) 编辑
摘要: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest palindromic substring.O(n*n)。对于每一个字符,以之作为中间元素往左右寻找。注意处理奇偶两种模式:1. aba2. abba 1 public class Solution { 2 public String longestPalindrome(String s) { ... 阅读全文
posted @ 2013-06-17 10:54 feiling 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length of 1.从 阅读全文
posted @ 2013-06-17 09:41 feiling 阅读(254) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2013-06-16 17:00 feiling 阅读(236) 评论(0) 推荐(0) 编辑
摘要: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).比较容易想到的做法是O(n),merge两个数组,然后求中值。 1 public class Solution { 2 public double findMedianSortedArrays(int A[], int B[]) { 3 // Sta... 阅读全文
posted @ 2013-06-15 18:07 feiling 阅读(460) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
posted @ 2013-06-15 17:50 feiling 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 1.两种比较接口分析在“集合框架”中有两种比较接口:Comparable接口和Comparator接口。Comparable是通用的接口,用户可以实现它来完成自己特定的比较,而Comparator可以看成一种算法的实现,在需要容器集合实现比较功能的时候,来指定这个比较器,这可以看成一种设计模式,将算法和数据分离。前者应该比较固定,和一个具体类相绑定,而后者比较灵活,它可以被用于各个需要比较功能的类使用。一个类实现了Camparable接口表明这个类的对象之间是可以相互比较的。如果用数学语言描述的话就是这个类的对象组成的集合中存在一个全序。这样,这个类对象组成的集合就可以使用Sort方法排序了。 阅读全文
posted @ 2013-06-10 16:36 feiling 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 在折线图上,每两个标记点的显示距离都是一样的,不管实际的间隔,100-1000和1000-10000 在坐标轴上的显示距离都一样所以如果你给的标记点本身是等距的,如1月 2月 3月 4月 5月。。。那他显示效果和散点图基本是一样的但如果标记点本身不等距,折线图显示的效果和散点图就不一样了折线图反映的是数据点相对的趋势,不是绝对的,散点图是绝对趋势的反映一般来说 用散点图比较合适 阅读全文
posted @ 2013-05-29 10:35 feiling 阅读(1835) 评论(0) 推荐(0) 编辑
摘要: auto eth1:0iface eth1:0 inet staticaddress 10.0.10.1netmask 255.255.255.0新添加一个子网10.0.10.0为了能让该子网内的主机都能上网,需要在iptables设置ip共享-A POSTROUTING -s 10.0.10.0/255.255.255.0 -j SNAT --to-source xxx.xxx.xxx.xxx这里xxx.xxx.xxx.xxx是你的外网地址这句话的作用是:把源地址是10.0.10.0这个网段中的数据包的源地址都改成xxx.xxx.xxx.xxx从而实现ip共享,POSTROUTING是与SN 阅读全文
posted @ 2013-05-19 14:37 feiling 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 1. 首先安装mysqlsudo apt-get install mysql-serversudo apt-get install mysql-workbench2. 导入数据(dump)用source 命令进入mysql mysql -u root -p mysql>use 数据库然后使用source命令,后面参数为脚本文件(如这里用到的.sql)mysql>source /mysqlbackup/boss_db.sql3. 配置mysql/etc/mysql/ 主要配置文件所在位置 my.cnfroot@ubuntu:/home/rgc# gedit /etc/mysql/my 阅读全文
posted @ 2013-05-02 22:31 feiling 阅读(344) 评论(0) 推荐(0) 编辑
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 43 下一页