自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(38)
  • 资源 (1)
  • 问答 (1)
  • 收藏
  • 关注

原创 工作中用到的一些软件

"工欲善其事,必先利其器"一款好的工具软件能够提升工作效率。开发工具:IntellijIDEA、PyCharm(不用解释)SSH仿真终端:secureCRT(用的人多,网上教程全面,上传文件方便),Termius(chrome内嵌)模拟请求工具:postmanmarkdown:MacDown思维导图:MindMaster用到再补充 ...

2018-08-19 21:30:04 431

原创 Java垃圾收集

1. Java的垃圾收集算法:  1.1 什么样的对象应该被清除?  引用计数算法:  给对象添加一个引用计数器,每个引用它的地方,计数器值加一,引用断开时,计数器值减一,当计数器值为0时,这个对象就是不可能再被     使用的,可以被清除;  引用计数算法简单,判定效率高,但是无法解决对象之间相互循环引用的问题;  可达性分析算法:  通过一系列GC Roots的对象

2017-03-11 20:48:14 452

原创 虚拟机中创建与访问对象

Java程序无时无刻不在和对象打交道。Java语言中创建对象使用new关键字,当虚拟机遇到一条new指令时,开始创建对象,分为以下几个步骤:1. 类加载、解析与初始化;2. 加载完成后,新对象所需要的内存空间大小已被确定,虚拟机将一块确定大小的内存从堆中划分出来,这里有两种分配方式,1. 若Java堆是规整的,则分配内存只需将指针向空闲空间那边移动一段与对象大小相等的距离,这种方式被称

2017-03-11 17:35:31 474

原创 Java内存区域

Java虚拟机在执行Java程序时,将它管理的内存划分为几个不同的数据区域,这些区域都有各自的用途以及创建和销毁的时间;Java虚拟机所管理的内存一般包括以下几个区域:1. 程序计数器一块较小的内存空间,是当前线程的行号指示器(字节码解释器工作时通过改变这个计数器的值来选择下一条需要执行的字节码指令),每条线程都需要有一个独立的程序计数器;此内存区域没有规定OutOfMemor

2017-03-11 17:19:18 473

原创 Java中String、StringBuilder与StringBuffer

String:字符串常量,源码中String的修饰符是public final的,final意味着不可改变;StringBuilder:字符串变量;StringBuffer:字符串变量;String作为字符串常量,是不可改变的,例如下面的代码:String str="hello ";str+="world";System.out.print(str);结果是:“hell

2017-03-10 17:20:55 452

原创 数据库范式

参考博客:http://www.cnblogs.com/xwdreamer/archive/2012/05/17/2506039.html数据库范式是关系数据库理论的基础,也是我们设计数据库结构过程中所遵循的规则和指导方法;常用的范式有三种:第一范式,第二范式,第三范式;第一范式(1NF):无重复的列    数据库表中的每一列都是不可分割的基本数据项,同一列中不能同时有多个值;

2017-03-10 09:57:15 515

原创 数据库索引小结

数据库索引,是数据库管理系统中一个排序的数据结构,以协助快速查询、更新表中的数据;即:在数据之外,数据库维护着满足特定算法的数据结构,这些数据结构以某种方式引用数据,这样就能在这些数据结构上实现高级查找算法,这样的数据结构就是索引;为表建立索引也是有代价的,索引需要占用额外的存储空间以及更新数据的同时可能要更新索引;如图:若需要加快第二列的查找速度,例如(SELECT Col1

2017-03-09 16:53:46 382

原创 数据库事务隔离级别

数据库事务:数据库事务是指作为单个逻辑单元执行的一系列操作,这些操作是一组不可分割的工作单位;事务具有原子性(Atomicity),一致性(Consistency),隔离性(Isolation),持久性(Durability);原子性:事务所包含的操作要么全部成功,要么出错回滚;一致性:事务必须使数据库从一个一致性状态变到另一个一致性状态,例如约束了a+b=10,一个事务改变了

2017-03-09 10:44:10 333

原创 Java中的equals方法和hashCode方法小结

equals方法和hashCode方法都是定义在Object类中,Java中比较两个对象是否相等,经常会使用==和equals方法;在Object类中,equals定义如下:public boolean equals(Object obj) { return (this == obj); }与==运算符一致,都是比较两个对象的地址是否相等;hashCode方法计算对

2017-03-08 22:37:00 358

原创 Java HashMap源码小结

本文基于jdk1.8.HashMap即哈希表,是一种能以常数平均时间完成插入,删除和查找操作的数据结构;哈希表有两种实现方式:开放地址方式和冲突链表方式;开放地址方式不需要使用链表,但是要频繁的再散列操作,常用的再散列方法有线性探测法,平方探测法,双散列法。冲突链表方式将所有哈希值相同的键用链表串起来,理想情况下的哈希表每个哈希值对应一个键,此时查找操作为常数时间;有两个参数与哈希表的

2017-03-08 21:51:56 328

原创 SpringBoot中常用的注解

SpringBoot用于简化Spring应用的搭建,开发及部署;该框架采用注解的方式进行配置可以很方便的构建Spring应用。1. @SpringBootApplication@SpringBootApplication 注解等价于以默认属性使用 @Configuration,@EnableAutoConfiguration 和 @ComponentScan,通常作为主类的注解;

2017-03-06 23:08:45 7219 1

原创 Java LinkedList 源码小结

LinkedList作为实现了List接口的一个实现类,其底层采用双向链表的方式构建,相比于ArrayList可以更快的完成插入/删除操作,但是随机访问速度慢,并且可以方便的实现队列、栈等数据结构(更好的选择是ArrayDueue),LinkedList未实现同步,需要同步时采用Collections.synchronizedList()方法对其进行包装;public class Linked

2017-02-21 21:36:33 369

原创 Springboot项目配置myBatis连接MySQL数据库

Springboot支持快速生成项目,生成前选择项目管理工具,我在此用maven做介绍:1.生成项目后,将得到的项目文件解压并导入IntelliJ IDEA,在pom.xml文件中配置myBatis,引入如下的依赖: org.mybatis.spring.boot mybatis-spring-boot-starter 1.1.1 org.mybatis mybatis 3.

2017-02-20 17:59:36 7505 1

原创 Java ArrayList源码小结

ArrayList是Java集合框架中的动态数组:public class ArrayList extends AbstractList implements List, RandomAccess, Cloneable, java.io.SerializableArrayList实现了List接口,实现了RandomAccess(随机访问)、Serializable(序列化);Rand

2017-02-10 23:03:15 329

原创 Servlet生命周期小结

Servlet的生命周期从Servlet类加载,到创建Servlet类实例,Servlet的初始化(真正成为一个Servlet),有请求到来,调用service方法(主要工作),直到Servlet被destroy;    1.Servlet类加载:        1.1  启动web容器后,容器去寻找应用的部署描述文件(web.xml),从部署描述文件中读取到上下文初始化参数,此时创建一个

2017-01-05 17:20:55 18461

原创 LeetCode 79(Word Search)java

原题:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertica

2017-01-04 22:54:22 2368

原创 常用的排序算法总结

今天是2016年12月31日,将这篇博客作为我2016年的总结,与2017年的开始,祝福自己明年找工作顺利!也祝福大家在新的一年心想事成,一帆风顺!    常用的排序算法主要分为直接插入排序、简单选择排序、冒泡排序、希尔排序、归并排序、堆排序、快速排序、计数排序、桶排序、基数排序十种,其详细的信息如下表所示:图片来源:http://blog.csdn.net/whuslei/art

2016-12-31 23:21:09 443

原创 LeetCode 97(Interleaving String)Java

原题:Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.给定3个字符串,判断s3是否可以由s1和s2交错组成;例如:s1="aa",s2="bc",s3="abca";s3可以由s1和s2交错组成;思路:很多字符串问题某一位置的解会与它上一位置的解有关,这种情

2016-12-01 10:17:03 484

原创 LeetCode 75(Sort Colors)Java

原题:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the inte

2016-12-01 09:41:24 399

原创 LeetCode 74(Search a 2D Matrix)Java

原题:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties1. Integers in each row are sorted from left to right.2. The first integer o

2016-12-01 09:33:45 413

原创 深度优先搜索算法(DFS) 总结

这段时间做DFS的题目一直处于这样一个状态:我知道这种类型的题(全遍历问题,N皇后问题)用DFS求解,但是在代码的实现上经常会遇到各种各样的问题,完成一个算法十分的拖泥带水,有时还需要跟着网上的代码走一遍。        我希望能有一种一劳永逸的思路来解决各种DFS问题,我有幸找到了一篇非常清晰地介绍DFS的通用解法的文章:http://blog.csdn.net/championle

2016-11-29 17:53:11 2136

原创 LeetCode 85 (Maximal-Rectangle)java

原题:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.For example, given the following matrix:求给定矩阵中全为1的最大长方形的面积;昨天A

2016-11-25 10:48:36 581

原创 LeetCode 89(Gray Code)java

原题:The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence

2016-11-25 10:16:42 432

原创 LeetCode 86(Partition List)java

原题:Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in

2016-11-24 16:02:27 1725

原创 LeetCode 84 (Largest Rectangle in Histogram)java

原题:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.求数组所构成的长方形中面积最大的;思路:见代码注释,我们经常会

2016-11-24 11:27:57 355

原创 LeetCode 55(Jump Game) Java

原题:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determin

2016-11-14 12:01:07 452

原创 LeetCode 54 (Spiral Matrix)Java

原题:Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.旋转打印矩阵;思路:我采取的是循环,应该考虑递归实现会清晰一些,之后考虑递归;去除特殊情况:最后一行是奇数应该怎么输出;代码:public class Sol

2016-11-14 11:54:23 332

原创 LeetCode 53(Maximum Subarray)Java

原题:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.寻找子数组的最大值思路:对于一个确定的子数组最大值来说,它一定满足:以其开头左边元素为末尾的任何一段子数组的和都小于0;若存在一段大于0的,则最大子数组就可以延长;所以设置一

2016-11-14 11:44:16 319

原创 LeetCode 50 Pow(x, n) Java

原题:Implement pow(x, n);思路:求幂次采用递归的方法;myPow( x , n )=myPow( x , n/2 ) * myPow( x , n/2 );考虑奇数次幂和偶数次幂相差一次;考虑负数次幂等于正数次幂的倒数;之后去除特殊情况:1. 幂次是Integer.MIN_VALUE不能直接取负;2. 除数不能为0;3. 幂次最大值不能超过Dou

2016-11-14 11:22:41 369

原创 LeetCode 第46,47题(Permutations)Java

原题:Given a collection of distinct numbers, return all possible permutations.第四十六题允许重复,四十七题不允许;在解法上有相似的地方;思路:这道全排列问题可以递归地去做,先确定一个值,对剩下的进行递归;实际上是一道关于深度优先搜索算法的题目;参考了这一篇博客:http://blog.csdn.net

2016-11-08 20:52:24 621

原创 LeetCode 第四十五题(Jump Game II)Java

原题:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your

2016-11-08 20:35:13 360

原创 LeetCode 第四十三题(Multiply Strings)Java

原题:Given two numbers represented as strings, return multiplication of the numbers as a string.思路:正是将我们学过的计算乘法的方法利用算法实现:1. 从某数最低位开始,计算它与另一个数相乘的结果,用一个数组记录下来;2. 遍历该数每一位置,每次都做第一步的工作;3. 处理和数组中的进位,得

2016-11-08 10:53:35 359

原创 LeetCode 第二十九题(Divide Two Integers)Java

原题:Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.计算两数相除的商;思路:将被除数dividend表示为除数的多项式:dividend = 2^i * divisor + 2^(i-1) * divi

2016-11-08 10:44:05 470

原创 LeetCode 第四十二题(Trapping Rain Water) Java

原题:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1

2016-11-07 21:07:13 308

原创 LeetCode 第三十一题(Next Permutation) java

原题: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 possi

2016-11-03 11:06:07 456

原创 LeetCode 第二十六题(Remove Duplicates from Sorted Array) java

原题:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place

2016-11-02 11:25:17 285

原创 LeetCode 第三题(Longest Substring Without Repeating Characters)Java

原题:Given a string, find the length of the longest substring without repeating characters.第一次做采取的是暴力的依次搜索每一个位置上的最长不重复子串,时间复杂度为O(N*N);这次在看了左老师的视频后,采用一次遍历,得到结果;算法思路:当前位置的最长不重复子串长度与上一位置的

2016-10-21 11:40:19 718

原创 LeetCode 第九题(Palindrome Number)Java

原题:Determine whether an integer is a palindrome. Do this without extra space.解题思路:1.回文数即正着读和反着读结果相同的数,所以,负数不是回文数;2.个位数都是回文数;3.对于一个数,想要确定它是否为回文数,可以先得到该数的颠倒位置的数(见LeetCode第七题),再判断两数是否相等,若相等,则

2016-10-20 16:13:04 314

学习OpenCV

学习OpenCV

2015-10-22

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

TA关注的人

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