随笔分类 -  algorithm

LeetCode Reverse Words in String (Java)
摘要:对一个字符串中的单词进行倒序输出如:“how are you”输出:“you are how”这实际上是一到很简单的题目,尤其是用Java提供的split()更简单。但是有一点很容易遗漏:s可能是一个很长的空格组成的字符串,这一点需要单独考虑。if (builder.length() != 0 &&... 阅读全文

posted @ 2014-10-27 21:56 jinfenglee 阅读(130) 评论(0) 推荐(0)

几种sort算法的Java实现
摘要:InsertionSort插入排序import java.util.Arrays;public class InsertionSort { public static void main(String[] args) { int[] a = new int[10]; ... 阅读全文

posted @ 2014-01-15 20:20 jinfenglee 阅读(168) 评论(0) 推荐(0)

导航