- 博客(3)
- 收藏
- 关注
原创 [study note]Java设计模式——单例模式
经典单例模式 在使用中这个类只有一个实例对象。并提供一个全局访问点。 首先我们先私有该类的构造方法,然后在自己内部new自己,这样就能控制这个类只有一个实例对象。 public class singleTon { private static singleTon st =null; private singleTon() { } public static
2018-01-09 15:46:42 125
原创 [leetcode]169. Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than [ n/2 ] times. You may assume that the array is non-empty and the majority element alw
2018-01-08 14:37:13 108
原创 [leetcode]696. Count Binary Substrings
最近手中项目全都结束,自己也处于空闲状态,于是就刷刷leetcode题库。一是让自己处在一种编程的状态;二是为了接触算法,让自己有些算法基础;三是让自己牢固Java的基础(毕竟去看源代码是一件让人很困倦,也很厌烦的事情),开始这类博文之前声明下:自己并非算法工程师所有的题目均是已实现作为目标,其次才会考虑时空复杂度的问题。如果大家有更好的解法希望能在评论中看到回复。
2018-01-02 13:54:02 201
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人