摘要: 1、私有化构造器,不能直接创建,调用方法创建对象; 2、饿汉式:instance在类装载时就实例化 3、静态内部类: 阅读全文
posted @ 2016-03-28 18:06 自朗活 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1、 Given an array of integers, find the subarray with smallest sum. Return the sum of the subarray. For [1, -1, -2, 1], return -3 2、 1、只需要求出最小值 2、利用su 阅读全文
posted @ 2016-03-28 18:00 自朗活 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 不大懂 1、 Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its 阅读全文
posted @ 2016-03-28 17:32 自朗活 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 没搞懂 1、 Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the ne 阅读全文
posted @ 2016-03-28 16:31 自朗活 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 1、 Merge two sorted (ascending) linked lists and return it as a new sorted list. The new sorted list should be made by splicing together the nodes of 阅读全文
posted @ 2016-03-28 16:22 自朗活 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1、 Given two sorted integer arrays A and B, merge B into A as one sorted array. A = [1, 2, 3, empty, empty], B = [4, 5] After merge, A will be filled 阅读全文
posted @ 2016-03-28 16:07 自朗活 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1、 Merge two given sorted integer array A and B into a new sorted integer array. A=[1,2,3,4] B=[2,4,5,6] return [1,2,2,3,4,4,5,6] 2、思路 1、创建一个大集合 2、判断, 阅读全文
posted @ 2016-03-28 16:01 自朗活 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1、 Given a collection of intervals, merge all overlapping intervals. 阅读全文
posted @ 2016-03-28 15:40 自朗活 阅读(219) 评论(0) 推荐(0) 编辑