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

全部博文(170)

文章存档

2016年(11)

2015年(130)

2014年(29)

发布时间:2015-03-22 17:07:31

import java.util.ArrayList;import java.util.Arrays;import java.util.List;public class threeSum {public static void main(String[] arg){int[] a=new int[]{0,0,0};System.out.print(threeSumSolution(a));}public static List<List<Integer>> threeSumSolution(int[] num) {List<List<Integer>> temp.........【阅读全文】

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

发布时间:2015-03-22 17:06:36

//Given an array of integers, every element appears twice except for one. Find that single one.////Note://Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?public class SingleNumber {public int singleNumber(int[] A) { .........【阅读全文】

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

发布时间:2015-03-22 17:06:06

public class SetMatrixZeroes {public static void main(String[] args) {// TODO 自动生成的方法存根}public void setZeroes(int[][] matrix) {        if(matrix.length==0){        return;       .........【阅读全文】

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

发布时间:2015-03-22 17:05:19

//Given a roman numeral, convert it to an integer.////Input is guaranteed to be within the range from 1 to 3999.//最后一个用来赋初值,前面的如果大于或等于就加上去,小于就减去这个import java.util.HashMap;import java.util.Map;public class RomanInteger { public int romanToInt(String s) {&nb.........【阅读全文】

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

发布时间:2015-03-22 17:04:41

import java.util.LinkedList;import java.util.Queue;import java.util.Stack;public class ReverseWordsinaString {public static void main(String []arg){System.out.print(reverseWords("a"));}public static String reverseWords(String s) {//if(s==null){//return null;//}if(s.length()==.........【阅读全文】

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

登录 注册