自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

adonis-stan的博客

记录自己的学习之旅

  • 博客(7)
  • 收藏
  • 关注

原创 设计模式学习 -- 单例模式

文章目录一、定义二、实现1. 饿汉模式2. 懒汉模式(线程不安全)3. 懒汉模式(线程安全)4. 双重检查模式(DCL)5. 静态内部类6. 枚举单例三、参考 一、定义 单例模式(Singleton Pattern),属于创建型模式。该模式确保一个类只有一个实例,并提供一个全局访问点。 使用单例模式的情况下,在内存中只有一个实例,减小了内存的开销。同时,对于频繁使用的重量级对象,省略了创建对象的时...

2019-12-07 15:06:58 226

原创 LeetCode -- 279. Perfect Squares(完美平方)

文章目录一、原文二、翻译三、分析3.1 BFS3.2 DP四、AC代码4.1 BFS代码4.2 DP代码 一、原文 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, …) which sum to n. Example 1: Input: ...

2019-05-08 16:03:04 330

原创 LeetCode -- 207. Course Schedule(课程计划)

文章目录一、原文二、翻译三、分析3.1 利用拓扑排序3.2 DFS四、AC代码4.1 利用拓扑排序4.2 DFS 一、原文 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for example to take course 0...

2019-04-30 10:58:18 179

原创 LeetCode -- 130. Surrounded Regions(周边区域)

文章目录一、原文二、翻译三、分析四、AC代码4.1. 代码14.2. 代码2 一、原文 Given a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’. A region is captured by flipping all 'O’s into 'X’s in that ...

2019-04-26 23:08:17 273

原创 LeetCode -- 108. Convert Sorted Array to Binary Search Tree(将有序数组转换为二叉搜索树)

文章目录一、原文二、翻译三、分析四、AC代码 一、原文 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is defined as a binary tr...

2019-04-15 19:41:00 191

原创 LeetCode -- 53. Maximum Subarray(最大子数组)

文章目录1. 原文2. 翻译3. 分析3.1. 普通法3.2. 动态规划法(DP)3.3. 分治递归(divide and conquer approach)4. AC代码4.1. 普通法4.2. DP4.3. 分治递归 1. 原文 Given an integer array nums, find the contiguous subarray (containing at least one...

2019-04-11 15:58:35 389

原创 LeetCode -- 31. Next Permutation(下一个排列)

文章目录原文 原文 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest...

2019-04-10 22:55:30 245

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除