自定义博客皮肤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)
  • 资源 (1)
  • 收藏
  • 关注

原创 Maven学习

Maven简介主要用于基于Java平台的项目构建、依赖管理和项目信息管理约定优于配置(Convention Over Configuration),使项目构建标准化,消除重复及琐碎的任务,且提供中央仓库,通过坐标系统来有序地管理以来核心是POM文件本文是对《Maven实战》的学习和总结

2015-06-11 21:39:10 830

原创 Gerrit服务器的搭建(Git+Gerrit+PostgreSQL+LDAP)

Gerrit简介Gerrit是搭建在Git之上的基于Web的代码审查工具。本文详细讲解了Gerrit服务器的搭建过程,Git+Gerrit+PostgreSQL+LDAP

2015-06-05 13:45:52 6017

原创 LeetCode | # 23

题目:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路:解法一:维护一个大小为k的堆,每次去堆顶的最小元素放到结果中,然后读取该元素的下一个元素放入堆中,重新维护好。因为每个链表是有序的,每次又是去当前k个元素中最小的,

2015-03-09 21:25:13 722

原创 LeetCode | #24 Swap Nodes in Pairs

题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant

2015-03-09 19:48:14 679

原创 LeetCode | #27 Remove Element

题目:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new lengt

2015-03-09 16:37:22 554

原创 禁用Eclipse update index

用Eclipse构建Maven项目后,默认每次打开Eclipse都会update index,这会占用大量资源,让电脑非常卡。其实update index就是自动更新而已,可以关闭这个功能,在运行Maven项目时再更新就行了,不用每次打开Eclipse就更新。关闭方法:Window ----> Preferences ---> Maven ---> 取消勾选Download rep

2015-01-27 11:08:08 4901

原创 LeetCode | #22 Generate Parentheses

题目:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:"((()))", "(()())", "(())()", "()(()

2015-01-25 20:53:52 664

原创 LeetCode | #21 Merge Two Sorted Lists

题目:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.思路:设置两个头指针,一个指针不动,用来返回最后头结点,一个指针用来组织节点顺序,遍

2015-01-25 17:53:40 824

原创 Java容器学习:List、Set、Queue、Map

一、容器很多时候,程序总是根据运行时才知道的某些条件去创建新对象,在此之前不知道所需对象的数量,甚至对象的类型,这时就需要容器来保存对象。Java容器类可以自动地调整自己的尺寸。容器类类库可以划分为两个不同的概念:Collection。一个独立元素的序列,如List(按照插入顺序保存元素),Set(不能有重复元素),Queue(按排队规则确定对象产生的顺序);Map。一组成对的“键

2015-01-25 16:46:44 720

原创 LeetCode | #20 Valid Parentheses

题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are

2015-01-25 15:30:28 635

原创 LeetCode | #19 Remove Nth Node From End of List

题目:Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the

2015-01-24 23:59:03 727

原创 LeetCode | #17 Letter Combinations of a Phone Number

题目:Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input

2015-01-24 22:35:19 726

原创 LeetCode | #14 Longest Common Prefix

题目:Write a function to find the longest common prefix string amongst an array of strings.思路:暴力,从头开始两两对比,将相同部分和下一个对比,O(N^2),超时;减少比较次数,先找出最短的元素,相同的部分肯定比这个长度短,两两比较时只要比较这个长度即可。public String

2015-01-17 23:38:44 566

原创 LeetCode | #13 Roman to Integer

题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路:罗马字符和数字的对应关系存储在map里,拿到字符串从前往后遍历,如果当前数字比后面的小,说明是减法,当做整体,如“XC” = 100-10=

2015-01-17 22:03:06 442

原创 LeetCode | #12 Integer to Roman

题目:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.思路:用二维数组记录每一位上0-9的罗马数字表示法,代替0-9public String intToRoman(int num) {

2015-01-16 22:20:25 442

原创 LeetCode | #11 Container With Most Water

题目:Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i,

2015-01-16 16:20:58 528

原创 LeetCode | #7 Reverse Integer

题目:Reverse digits of an integer. The reversed integer might overflow.Example1: x = 123, return 321Example2: x = -123, return -321思路:一开始想,不断除10取余,余数放在数组里,然后再乘10累加,注意用long,并且检查翻转后的数是

2015-01-15 21:51:27 526

原创 LeetCode | #6 ZigZag Conversion

题目:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA

2015-01-15 20:57:35 370

原创 LeetCode | #5 Longest Palindromic Substring

题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.思路:暴力

2015-01-15 14:43:39 513

原创 LeetCode | #2 Add Two Numbers

题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it

2015-01-14 17:40:18 548

原创 LeetCode | #1 Two Sum

终于开始在LeetCode上刷题了,第一弹:我是渣。首先想到最暴力最简单的方法:双循环,两个两个地试。可以求解,但是超时,时间复杂度O(N^2)。然后想到把大于target的数去掉,少试一点,发现题目说的是整数,可以存在负数。再然后想到排序:先快排,然后从第一个数开始,算出差值,然后去剩下的序列中二分查找这个差值;或者从头尾设两指针,相加大于target,尾指针-1,相

2015-01-14 15:22:14 556

原创 IdentityHashMap——允许键重复

在Map的几种实现里,HashMap、LinkedHashMap 等存放键值对时,key是不允许重复的。如果已存在该key,后put进来的键值对会覆盖已存在的键值对。        这是因为,此类利用哈希表实现的 Map 接口,是使用Object.equals()方法来判断当前的键是否与表中存在的键相同。        首先我们要清楚一个概念,即对象和对象引用:对象引用和基本数据类型是存放

2014-03-07 14:58:22 3985

原创 Java爬虫:爬取豆瓣图片之代码

关于豆瓣相册页面的特征提取和分析,详见我的另一篇博文:            《初涉爬虫:爬取豆瓣图》http://blog.csdn.net/allhaillouis/article/details/20226127        本贴展示代码,效果:爬取豆瓣相册,每个页面的图片分开保存在子文件夹下。package douban;import java.io.Buff

2014-03-07 13:02:41 3088

转载 豆瓣robots.txt分析

豆瓣的robots内容如下:========================================================User-agent: *Disallow: /subject_searchDisallow: /amazon_searchSitemap: http://www.douban.com/sitemap_index.xmlSitemap:

2014-03-01 20:44:13 2478

原创 Spring的初步认识

一、 企业级Java开发与J2EE        不同于坐在学校寝室笔记本前编写Java课堂作业这样的小打小闹,Java企业级开发涉及到很多方面的技术,如数据库、Web应用服务、事务处理等,需要考虑性能、安全、可扩展性等一系列需求。很多公司在进行企业级开发时,为了提高应用的可扩展性和复用性,都会开发自己的通用服务模块,这些服务性的软件系列统称为中间件。中间件处于操作系统和更高一级的应用程序之间

2014-03-01 17:08:33 868

空空如也

空空如也

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

TA关注的人

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