
算法
chenyongsheng91
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
leetcode----Merge Two Sorted Lists
此题目验证算法存在问题,因为timu原创 2014-04-14 21:07:06 · 681 阅读 · 0 评论 -
leetcode----Two Sum
思路:将数组bianli原创 2014-04-05 21:18:20 · 643 阅读 · 0 评论 -
leetcode----Reverse Integer
public int reverse(int x){ int ans = 0; int flag = 1; if(x < 0){ flag = -1; x = -x; } String str = Integer.toString(x); char [] charArray = str.toCharArray(); for(int i = charArray原创 2014-04-06 20:00:45 · 629 阅读 · 0 评论 -
leetcode----Zigzag Conversion
public String convert(String s, int nRows) { String finalString = ""; char []array = s.toCharArray(); if(nRows == 1){ return s; } String []string = new Strin原创 2014-04-05 21:23:53 · 699 阅读 · 0 评论 -
leetcode----Maximum SubArray
public int maxSubArray(int[] A) { int ans = A[0]; int max = 0; for (int i = 0; i < A.length; i++) { max += A[i]; if(max > ans) ans = max; if(max < 0)原创 2014-04-06 20:19:35 · 692 阅读 · 0 评论 -
leetcode----Palindrome Number
public boolean isPalindrome(int x) { if(x < 0){ return false; } if(x < 10){ return true; } String string = Integer.toString(x); char []array = string.toCharArray(); int length = ar原创 2014-04-06 20:08:24 · 655 阅读 · 0 评论