发布时间: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.........【阅读全文】
发布时间:2015-03-22 17:00:36
import java.util.ArrayList;import java.util.List;//Given an index k, return the kth row of the Pascal's triangle.////For example, given k = 3,//Return [1,3,3,1].////Note://Could you optimize your algorithm to use only O(k) extra space?public class PascalTriangleTwo {public static void .........【阅读全文】
发布时间: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.........【阅读全文】