原创 LeetCode 5 最長迴文子串 Manacher線性算法

題目鏈接:https://oj.leetcode.com/problems/longest-palindromic-substring/ 迴文串即正向反向序列都一樣的連續序列 如abba,abcba... 爲了統一回文串的偶數情況和奇數

原创 10 Open Source Security Tools from Google, Facebook, Netflix and Cisco

原文地址:http://www.linux.com/news/software/applications/797378-10-open-source-security-software-tools 源自Google,Facebook

原创 JAVA基礎課程設計 簡易掃雷

以下每行代碼,文字均爲原創,轉載請註明出處. 程序一共分爲7個文件,每個文件爲一個類 文件名 功能描述 Test.java 測試類,包含main()函數 Mine.java 設計主界面, Calmine.java 隨機雷的位置.計算雷區

原创 LeetCode Merge Two Sorted Lists

鏈接: https://oj.leetcode.com/problems/merge-two-sorted-lists/ 題目要去把兩個有序的鏈表合併,並且合併後的鏈表依然有序. /** * Definition for singly

原创 LeetCode Minimum Path Sum

鏈接: https://oj.leetcode.com/problems/minimum-path-sum/ 簡單的動態規劃. [i][j]表示到達位置(i,j)時的最小sum public class Solution { pu

原创 LeetCode Reorder List

鏈接: https://oj.leetcode.com/problems/reorder-list/ 空間複雜度爲O(n),時間複雜度爲 O(n)的代碼: /** * Definition for singly-linked lis

原创 LeetCode Single Number II

鏈接: https://oj.leetcode.com/problems/single-number-ii/ 雖然知道這個題肯定跟位運算,異或有關...但實在沒想出來怎麼解決 class Solution { public: i

原创 LeetCode Maximum Product Subarray

鏈接: https://oj.leetcode.com/problems/maximum-product-subarray/ 求最大連續序列的乘積 因爲偶數個負數相乘爲正數,且任何數乘0等於0 .所以在計算的過程中需要維護兩個數組,一個記

原创 LeetCode Best Time to Buy and Sell Stock II

鏈接: https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/ class Solution { public: int maxProfit(vect

原创 LeetCode Find Peak Element

鏈接: https://oj.leetcode.com/problems/find-peak-element/ 題目要求複雜度在對數級以內 對數組下標進行二分搜索, public class Solution { public int

原创 LeetCode 3sum

鏈接: https://oj.leetcode.com/problems/3sum/ 2sum:尺取法 通過a+b與target比較,.根據大於或小於不斷縮小範圍 3sum:即對0~n個數分別做2sum... 去重: if(i!=0&

原创 vim 常用插件的安裝

安裝如下幾個插件 taglist 以分割窗口顯示代碼結構預覽 下載地址:http://www.vim.org/scripts/script.php?script_id=273 stl STL語法高亮 下載地址:http://www.v

原创 LeetCode Evaluate Reverse Polish Notation

鏈接: https://oj.leetcode.com/problems/evaluate-reverse-polish-notation/ 後綴表達式求值 class Solution { public: int evalRPN

原创 JAVA基礎課程設計 簡易坦克大戰

工程的結構如下: 類名 父類/接口 功能 Paly void 音頻播放 Wel_Panel JPanel 歡迎界面 keylistener KeyAdapter 鍵盤監聽 PC_tan

原创 eclipse快捷鍵

Ctrl+1 快速修復(最經典的快捷鍵,就不用多說了)Ctrl+D: 刪除當前行 Ctrl+Alt+↓ 複製當前行到下一行(複製增加)Ctrl+Alt+↑ 複製當前行到上一行(複製增加)Alt+↓ 當前行和下面一行交互位置(特別實用,可以