Write a function to find the longest common
prefix string amongst an array of strings.
要减少比较次数。在实现过程中我的想法是,2个2个比较,那么只要遍历一次数组就好。而且,在比较过程中,以较短的那个长度作为最大比...
分类:
其他好文 时间:
2014-05-26 21:29:43
阅读次数:
203
LinearLayout linearLayoutMain = new
LinearLayout(this);//自定义一个布局文件 linearLayoutMain.setLayoutParams(new
LayoutParams( LayoutParams.MATCH_PARENT, ...
分类:
移动开发 时间:
2014-05-26 16:22:12
阅读次数:
257
向上遍历DOM树:.parent().parents().parentsUntil()向下遍历DOM树:.children().find()DOM树水平遍历:.siblings().next().nextAll().nextUntil().prev().prevAll().preUntil()三个最...
分类:
Web程序 时间:
2014-05-23 07:05:00
阅读次数:
286
注意两点
1.通过android:checkedButton="@+id/lunch"而不是item中的 android:checked="true"设置的某人被选中状态
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
a...
分类:
其他好文 时间:
2014-05-23 00:04:35
阅读次数:
344
Given a binary tree, find its maximum depth.The
maximum depth is the number of nodes along the longest path from the root node
down to the farthest le...
分类:
其他好文 时间:
2014-05-22 16:05:56
阅读次数:
239
Evaluate the value of an arithmetic expression
inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an
integer or another express...
分类:
其他好文 时间:
2014-05-22 15:28:54
阅读次数:
175
今天编写代码如下:发现2个radiobutton居然都可以选中。这我真的晕了。。后来偶然发现原来是没有设置Id的原因。。。
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizont...
分类:
其他好文 时间:
2014-05-21 17:12:25
阅读次数:
246
使用意图调用内置应用程序
1、创建一个新的Android项目并命名为Intents,在main.xml文件中添加两个Button:
<Button
android:id="@+id/btn_webbrowser"
android:layout_width="fill_parent"
android:layout_heigh...
分类:
移动开发 时间:
2014-05-21 16:24:12
阅读次数:
298
Valid Parentheses括号匹配问题...
分类:
其他好文 时间:
2014-05-21 16:02:30
阅读次数:
161
问题描述
最长公共子序列,英文缩写为LCS(Longest Common Subsequence)。其定义是,一个序列 S ,如果分别是两个或多个已知序列的子序列,且是所有符合此条件序列中最长的,则 S 称为已知序列的最长公共子序列。
解决最长公共子序列,一种常用的办法,就是穷举法,组合出所有的情况,但是这样对于长序列的情况来说,是非常不实际。。
假设现在有...
分类:
其他好文 时间:
2014-05-21 13:55:35
阅读次数:
260