发布时间: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;  .........【阅读全文】
发布时间: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.........【阅读全文】
发布时间: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()==.........【阅读全文】
发布时间:2015-03-22 17:03:51
import java.awt.Dialog.ModalExclusionType;import java.awt.image.RescaleOp;import java.util.LinkedList;import java.util.Queue;import java.util.Stack;//Reverse digits of an integer.////Example1: x = 123, return 321//Example2: x = -123, return -321public class Rev.........【阅读全文】
发布时间:2015-03-22 17:02:18
//Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.////For example,//Given 1->2->3->3->4->4->5, return 1->2->5.//Given 1->1->1->2->3, return 2->3.class ListNode { int val; L.........【阅读全文】