Chinaunix首页 | 论坛 | 博客
  • 博客访问: 266727
  • 博文数量: 170
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1709
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-06 18:01
文章分类

全部博文(170)

文章存档

2016年(11)

2015年(130)

2014年(29)

发布时间:2015-03-22 16:59:20

mport java.util.ArrayList;import java.util.List;//Given numRows, generate the first numRows of Pascal's triangle.////For example, given numRows = 5,//Return////[//     [1],//    [1,1],//   [1,2,1],//  [1,3,3,1],// [1,4,6,4,1]//]public class PascalsTriang.........【阅读全文】

阅读(209) | 评论(0) | 转发(0)

发布时间:2015-03-22 16:58:34

//Palindrome Number Total Accepted: 35430 Total Submissions: 122024 My Submissions Question Solution //Determine whether an integer is a palindrome. Do this without extra space.public class PalindromeNumber {public boolean isPalindrome(int x) {        if(x<0)&nb.........【阅读全文】

阅读(237) | 评论(0) | 转发(0)

发布时间:2015-03-22 16:56:29

/Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.class Point {    int x;    int y;    Point() { x = 0; y = 0; }    Point(int a, int b) { x = a; y = b; } }public class MaxPoints {public sta.........【阅读全文】

阅读(458) | 评论(0) | 转发(0)

发布时间:2015-03-22 16:55:55

//Find the contiguous subarray within an array (containing at least one number) which has the largest product.////For example, given the array [2,3,-2,4],//the contiguous subarray [2,3] has the largest product = 6.public class MaximumProductSubarray {public static void main(String[] a.........【阅读全文】

阅读(242) | 评论(0) | 转发(0)

发布时间:2015-03-22 16:54:56

import java.util.Arrays;//Given an unsorted array, find the maximum difference between the successive elements in its sorted form.////Try to solve it in linear time/space.////Return 0 if the array contains less than 2 elements.////You may assume all elements in the array are non-n.........【阅读全文】

阅读(187) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册