原创 【Leetcode解題記錄】15. 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in th

原创 【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 let

原创 Java排序:冒泡排序、快速排序、堆排序

冒泡排序:  一趟排序:將第一個記錄和第二個記錄進行比較,如果第一個比第二個大就兩個記錄交換,直到第n-1個記錄和第n個記錄比較爲止。   之後的排序對前n-1個記錄進行同樣操作。   時間複雜度爲O(n^

原创 《Java設計模式》中出現的問題彙總

1. 寫出在Java中抽象類和接口的區別。一個類可以實現多個接口,但只能繼承最多一個抽象類。抽象類可以包含具體方法;接口的所有方法都是抽象的。抽象類可以聲明和使用字段;接口不能,但可以創建靜態的final常量。抽象類中的方法可以是publ

原创 Mysql 在Java中常用語法合集(不斷更新)

因爲在做項目中經常會用到一些常用語法,所以在學習中不斷完善這部分內容。 項目基本由Java完成,所以其中也大部分爲mysql在Java中的實現方法。 獲取到最新一條數據: select * from urlmanager where t

原创 【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 displa

原创 Github上傳代碼菜鳥超詳細教程【轉+整合】

這篇文章寫得是windows下的使用方法。 第一步:創建Github新賬戶 第二步:新建倉庫 第三部:填寫名稱,簡介(可選),勾選Initialize this repository with a README選項,這是自動創

原创 【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 ar

原创 Centos 7.2 搭建Apache+PHP+Mysql環境

現在騰訊雲和阿里雲都有針對學生的優惠政策,騰訊雲每個月一塊錢就有服務器加域名,阿里雲每個月十塊錢一個服務器,兩個都可以去嘗試使用下,這個博客放在騰訊雲服務器上,搭建的是windows環境,另一個 攝影 網站搭建在阿里雲服務器上,使用的是

原创 Lucene 6.0以上版本使用IKAnalyzer分詞器

Lucene 6.0使用IK分詞器需要修改修改IKAnalyzer和IKTokenizer. 使用時先新建一個MyIKTokenizer類,一個MyIkAnalyzer類: MyIKTokenizer.java import jav

原创 【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.-------比較簡單,只

原创 【Leetcode解題記錄】3. Longest Substring Without Repeating Characte

尋找最長不重複字串Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb

原创 Jsoup 亂碼問題解決

一般出現這個情況是由於url指向的頁面,實際編碼與html中描述的編碼不符導致。如:開發時用的GBK編碼編寫,但html中卻寫UTF-8。典型的就是在中文Windows下用記事本,寫一個UTF-8的html就會出現這個問題。 你可以不用j