自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 算法|快速排序

1. 思路通过arr[q]将数组arr[p...r]划分成两个子数组arr[p...(q-1)]、arr[(q+1)...r],前一个子数组所有元素<=arr[q],后一个子数组所有元素>=arr[q]。以同样的做法对子数组进行递归划分,最后数组arr就排序好了。在这过程中,计算下标q,即划分子数组(partition)是快速排序最关键的一部分。① 划分选择一个x=arr[r]作...

2019-02-06 00:16:58 137

原创 LeetCode | 58. 最后一个单词的长度

题目给定一个仅包含大小写字母和空格 ’ ’ 的字符串,返回其最后一个单词的长度。如果不存在最后一个单词,请返回 0 。说明一个单词是指由字母组成,但不包含任何空格的字符串。示例输入: "Hello World"输出: 5题解先去掉字符串的头尾空格,再从尾部开始扫描。class Solution { public int lengthOfLastWord(String ...

2019-01-17 00:01:10 150

原创 LeetCode | 14. 最长公共前缀

题目编写一个函数来查找字符串数组中的最长公共前缀。如果不存在公共前缀,返回空字符串 “”。示例 1:输入: ["flower","flow","flight"]输出: "fl"示例 2:输入: ["dog","

2019-01-12 22:08:08 150

原创 LeetCode | 35. Search Insert Position

题目提供一个已排序且没有重复数字的数组和一个目标值,如果在数组中找到目标值则返回目标值的下标,如果找不到则返回该目标值可能存在的下标位置。例子 1输入: [1,3,5,6], 5输出: 2例子 2输入: [1,3,5,6], 2输出: 1例子 3输入: [1,3,5,6], 7输出: 4例子 4输入: [1,3,5,6], 0输出: 0题解遍历数组,只要目标值...

2019-01-11 00:34:31 99

原创 LeetCode | 27. Remove Element

Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array...

2019-01-10 20:19:39 106

原创 LeetCode | 13. Roman to Integer

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D ...

2019-01-09 17:55:14 105

原创 LeetCode | 20. Valid Parentheses

Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of bra...

2019-01-08 23:22:19 93

原创 LeetCode | 9. Palindrome Number

Determine whether an integer is a palindrome(回文). An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Output: falseExplan...

2019-01-08 16:20:35 107

原创 SpringBoot2.x | 控制层路径映射

在Controller层中可以通过以下方式对同一文件夹下的多个html映射。import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.PathVariable;import org.springframework.web.bind.annotation.R...

2018-12-04 23:16:14 806

原创 SpringBoot2.x | 时区设置

在插入数据库以及从数据库查询出的时间数据发现比当前时间少了8个小时,需要增加一些配置来解决这个问题。application.properties# 数据库配置spring.datasource.url=jdbc:mysql://localhost:3306/bookstore?useSSL=false&useUnicode=true&characterEncoding=u...

2018-11-18 11:53:19 3563

原创 SpringBoot2.x | 请求参数POJO传递

前端发起请求,将表单Post到后台,表单对应的参数名应该为和后台的POJO属性名一致。会员entity类package com.bookstore.entity;import com.fasterxml.jackson.annotation.JsonFormat;import java.util.Date;public class Vip { private Integ...

2018-11-17 20:26:25 1143

原创 vue | 同步请求

Vue同步请求axios不能发起同步请求,所以我们可以使用JQuery来发起请求。安装插件:npm install jquery --s使用<script>import $ from 'jquery'method: { asyncPost: function(value) { let request = $.ajax({ type: 'POST',...

2018-11-05 00:03:11 4164 1

原创 SpringBoot2.x | Json及时间戳处理

pom.xml<!-- Json解析 --><dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.51</version</dependency

2018-10-28 13:28:20 2604

原创 SpringBoot2.x | 分页插件PageHelper

pom.xml<!-- 分页插件 --><dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-s

2018-10-26 02:00:33 2583

原创 vue+framework7

vue+framework7vue/cli3搭建vue项目:# 安装vue/cli3npm install -g @vue/cli# 查看vue版本vue -version# 创建一个vue项目,f7-vue为项目名vue create f7-vue# 运行npm run serve由于Eslint比较烦人,不安装Eslint依赖。步骤Manually selec...

2018-09-23 00:25:57 1293

原创 SpringBoot2.x|从零开始搭建个人博客(一)

创建项目:https://start.spring.io/ layui:https://www.layui.com/项目Init通过IDEA打开项目后,创建出以下的文件结构。|- - blogs        |- - src   &amp

2018-09-06 00:57:25 1204

原创 SpringBoot2.x|创建Spring Boot项目

官网:https://spring.io/projects/spring-boot 创建Spring Boot项目:https://start.spring.ioSpringBoot为我们提供了一个创建项目的网站,我们通过它来创建项目,并且通过IDEA来编写代码。 我们通过Maven来进行项目的管理。在Maven中,Group是包的名称,Artifact则是项目的名称。最重...

2018-09-05 00:03:56 472

原创 SpringBoot2.x|Shiro

Shiro Shiro专注于易用性,可以进行安全,稳定的身份验证,授权,加密和会话管理。配置个人采用的springboot版本是springboot 2.0.4pom.xml<!-- 版本配置 --><properties> <shiro.version>1.3.2&am

2018-09-03 00:40:19 721

原创 SpringBoot2.x|Thymeleaf页面不能正常载入css、js文件

Html css及js文件引入采用绝对路径。<!-- reset, layui and login --><link rel="stylesheet" th:href="@{~/static/css/reset.css}&amp

2018-09-02 18:01:32 8690

原创 算法|插入排序

插入排序解析工作机理:与打牌时整理手中牌的做法差不多,假设一开始左手为空,整理卡牌时是每次从桌上拿起一张卡牌,插入到左手中已整理好的序列中。代码解析:从工作机理可知,我们需要两层循环,第一层循环遍历桌上的每一张卡牌,第二层遍历左手中已整理好的卡牌,第一层遍历到的卡牌与第二层已排序好的卡牌逐一比较,找到可插入的地方插入,即交换位置。举例 特点:原地排序,即在已有的数组上排序,不...

2018-07-12 11:09:40 153

空空如也

空空如也

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

TA关注的人

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