自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 设计模式

欢迎使用Markdown编辑器写博客 本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦: 设计模式的由来 设计模式起源于建筑,由Christopher Alexander(克里斯托弗.亚历山大)及其研究团队用了约20年的时间,对住宅和周边环境进行了大量的调查研究和资料收集工作,发现人们对舒适住宅和城市环境存在一些共同的认同规律。对每一个模式(Patt...

2018-07-09 14:25:51 410

原创 Redis入门

Redis入门 1.为什么需要NoSQL( Not Only SQL) High performance-高并发读写 Huge Storage-海量数据高效率存储和访问 High Scalability && High Availability-高可扩展性和高可用性 2.NoSQL数据库的四大分类 键值(key-value)存储 列存储 文档数据库 图形数据库...

2018-06-03 21:49:42 220

原创 Java基础知识总结(入门准备)

1. java的特性和优势:简单性,面向对象,可移植性,高性能性,动态性,多线程,安全性,健壮性。2. java的运行机制,计算机高级编程语言类型有:编译型和解释型,java语言是这两种类型的结合,利用编辑器编写java源程序(源文件名–主类名.java),利用编译器(javac)将源程序编译成字节码(字节码文件名–源文件名.class),再利用虚拟机(解释器,java)解释执行,运行的过程:载入,

2017-02-08 02:01:29 291

原创 Think In Java第六章 访问权限修饰符

组合与继承:两种复用代码的方法: 第一种:只需要在新的类中产生现有类的对象,由于新的类是由现有类的对象组成的,所以这个方法称为组合,该方法只是复用了现有程序代码的功能,而并非它的形式。 第二种:按照现有的类的类型进行创建新类。无需改变现有类的形式,采用现有类的形式并在其中添加新的代码,称之为继承。 初始化引用,可以在代码中的下列位置进行: 定义对象的地方。 在类的构造器中。 在正要使用这些对象之前,

2016-12-04 17:50:29 272

原创 Leetcode35. Search Insert Position

题目描述:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2016-12-03 16:01:18 298

原创 Leetcode34. Search for a Range

题目描述:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target is not found in t

2016-11-30 16:05:35 172

原创 Leetcode74. Search a 2D Matrix

题目描述:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted from left to right.The first integer of each ro

2016-11-30 14:52:39 174

原创 Leetcode69. Sqrt(x)

题目描述:Implement int sqrt(int x).Compute and return the square root of x.题目要求:要求我们求取x的平方根题目分析:本题与之前的Arranging Coins那道题很相似,都是可以使用一般的迭代方法O(n)的时间复杂度,和二分法O(logn)的时间复杂度http://blog.csdn.net/qq_27896185/article

2016-11-30 14:15:21 193

原创 Leetcode441. Arranging Coins

题目描述:You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the total number of full staircase rows that can be formed.n is

2016-11-30 13:21:17 212

原创 Think In Java第六章 访问权限修饰符

java访问修饰符: 包访问权限(friendly):当前包中的所有类对那个成员都具有访问权限,但是对于这个包之外的所有的类,这个成员是private的。由于一个编译单元(即一个文件),只能隶属一个包,所以经由包访问权限,处于同一个编译单元中的所有类彼此之间都是可以自动访问的。 取得对某成员的访问权的唯一途径是:1.使得该成员成为public。2.通过不加访问权限修饰符并将其他类放置于同一包内的方式

2016-11-29 22:50:20 348

原创 Leetcode278. First Bad Version

题目描述:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on

2016-11-28 21:44:30 220

原创 Leetcode350. Intersection of Two Arrays II

题目描述:Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. Note: Each element in the result should appear as many times as

2016-11-28 21:30:03 154

原创 Leetcode349. Intersection of Two Arrays

349. Intersection of Two Arrays题目描述:Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element in the result mus

2016-11-28 20:24:10 215

原创 Leetcode 412.Fizz Buzz

题目描述:Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.

2016-11-28 18:16:53 307

原创 Leetcode374. Guess Number Higher or Lower

题目描述:We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I’ll tell you whether the number is higher or

2016-11-28 18:04:33 177

原创 Leetcode 70.Climbing Stairs

题目描述:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?题目含义:共有n层的楼梯,你每次只能走一节或者两节的楼梯,那么问

2016-11-28 14:11:46 255

原创 设计模式之Iterator和容器与迭代器遍历

Iterator本身也是四人帮本身定义的23种设计模式之一,用的并不多,一般只是出现在容器的遍历。首先我们先写一个可以动态添加对象的容器:public class ArrayList { //使用数组来模拟一个可以装任意数量的容器 Object[] objects = new Object[10]; int index = 0; pub

2016-11-28 13:30:06 412

原创 设计模式之stategy和C&C接口

设计模式之stategy和C&C接口马士兵设计模式视频及源码:链接: https://pan.baidu.com/s/1bHhkU6 密码: 35bd假设我们要写一个排序的小程序,程序如下:public class DataSorter { //冒择路(入)兮(希尔)快归堆 //冒泡算法 public static void sort(int[] nu

2016-11-27 01:01:56 642

原创 剑指Offer之斐波那契数列问题

题目要求查找斐波纳契数列中第 N 个数。所谓的斐波纳契数列是指: 前2个数是 0 和 1 .第 i 个数是第 i-1 个数和第i-2 个数的和。 斐波纳契数列的前10个数字是:0, 1, 1, 2, 3, 5, 8, 13, 21, 34 ...样例:给定 1,返回 0给定 2,返回 1给定 10,返回 34解题思路:我们可以使用递归和循环两种方式,通常递归会比较简洁,并且更容易实现。不过,虽然递归

2016-11-26 10:07:34 398

原创 剑指Offer之Fizz Buzz 问题

题目要求:给你一个整数n. 从 1 到 n 按照下面的规则打印每个数: 如果这个数被3整除,打印fizz. 如果这个数被5整除,打印buzz. 如果这个数能同时被3和5整除,打印fizz buzz. 样例:比如 n = 15, 返回一个字符串数组:[ "1", "2", "fizz", "4", "buzz", "fizz", "7", "8", "fizz", "buzz", "1

2016-11-25 11:29:59 333

原创 LeetCode Binary Search

LeetCode Binary Search首先开始Binary Search系列的学习,这个系列的习题主要是考察二分查找的这一类题往往有相同的特征。例如: 题目会给定一段有序的序列 在题目中会出现例如first或者last这样的字眼 又或者题目会让我们在O(logn)的时间内完成 又或者题目要求我们在一段范围内之间寻找目标元素 对于Binary Search这类题,其实做起来并不困难,困难的是怎么

2016-11-24 19:47:52 301

原创 设计模式之OO思想

OO思想即为面向对象的思想 封装: 方法 –> 类 Person类与美国人不应该写成两个类或者是写成美国人继承人这个类,而是应该将国籍做为Person的一个属性 老张开车去东北(使用面型对象的方法进行封装)1.抽取名词成为类,切记需要具体而不是笼统,例如对于上面的句子而言,我们不应该抽取出一个Person类而是应该抽取出一个Driver类,但是也不可以过于具体,例如我们

2016-11-24 16:04:55 425

原创 Think In Java第二章 一切都是对象

1. 使用引用来操纵对象2. jvm中的内存分布3. 基本数据类型基本数据类型 大小 包装类 boolean --- Boolean char 16-bit Character byte 8-bit Byte short 16

2016-11-24 15:08:05 314

原创 Think In Java第一章 对象导论

java是单继承,跨平台 万物皆为对象 程序是对象的集合,他们通过发送消息来告知彼此所要做的事 每个对象都有自己的由其他对象所构成的存储 每个对象都拥有其类型 某一特定类型的所有对象都可以接收同样的消息

2016-11-24 12:05:09 253

原创 数据结构详细解析

数据结构之表1. 概述在类库中,Java语言包含有一些普通的数据结构的实现,通常称为Collection API。1.1 Collection接口Collection API位于java.util包中,集合(Collection)的概念在Collection接口中得到了抽象,用来存储一组类型相同的对象。通过查阅API可以发现Collection接口中包括了许多重要的抽象方法,但是查阅API时我们发现

2016-11-23 13:32:42 1015

空空如也

空空如也

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

TA关注的人

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