- 博客(8)
- 资源 (5)
- 收藏
- 关注
原创 java 静态内部类和Builder模式
1. 概念 在java中可以在类内部定义静态内部类。可以用于构建多参数的对象,并且保证类的一致性。 2. 与非静态内部内的区别 静态内部类与非静态内部类的区别如下: 在非静态内部类中不可以声明静态成员。只有静态内部类才能够定义静态的成员变量与成员方法。非静态内部类,可以随意的访问外部类中的成员变量与成员方法。静态内部类只能引用外部类中的静态的成员(变量或方法),而不能够访问非静态的
2015-10-30 22:29:10 4432
转载 leetcode 233: Number of Digit One
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. For example: Given n = 13, Return 6, because digit 1 occurred in the follow
2015-10-29 16:17:11 406
原创 leetcode 23:Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 题目分析:两个链表的链接会不会,归并排序,复杂度为O(N),N为节点数。 多个链表排序,两个两个归并,再归并,这样相当于做了logK层,每一层都为N,则复发度为o(NlogK), public
2015-10-25 21:23:01 283
原创 leetcode:ExpressionAddOperators282 细致讲解 以及代码实现
Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the digits so they evaluate to the target value.
2015-10-24 14:27:19 1198
原创 leetcode 295:Find Median from Data Stream
Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value. Examples: [2,3,4] , the median
2015-10-23 17:13:29 369
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人