原创 Git(分佈式版本控制系統)初識(一)

如何通過git將本地的文件上傳到github的倉庫中 一些基本知識 一、在官網上下載git並且按安裝 過程略… 二、對git進行初始化 1、設置用戶名 git config --global user.name 'u-hechx

原创 LeetCode(六)104. Maximum Depth of Binary Tree

題目描述: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path fr

原创 LeetCode(一)Reverse Words in a String III

題目描述: Given a string, you need to reverse the order of characters in each word within a sentence while still preservi

原创 LeetCode(五)102. Binary Tree Level Order Traversal

題目描述: Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by l

原创 LeetCode(四)101. Symmetric Tree

問題描述: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). Note: Bonus poi

原创 LeetCode(三)58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ’ ', return the length of last wor

原创 LeetCode(二)387. First Unique Character in a String

題目描述 Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return

原创 算法之(四)NP完全性理論

一、 P類問題:能夠在多項式時間內解決的 NP類問題:能夠在多項式時間內容驗證的(只要在多項式時間內容猜出一個解) P類問題是NP問題的子集,因爲存在多項式時間解法的問題,就一定能在多項式時間內驗證它 約化(規約):一個問題A可以約化

原创 算法之(二)判斷一個單鏈表是否有環

轉載 http://www.cnblogs.com/ghimtim/p/4882916.html 思路:如果一個單鏈表中有環,用一個指針去遍歷,永遠不會結束,所以可以用兩個指針,一個指針一次走一步,另一個指針一次走兩步,如果存在環

原创 一個程序員的Java和C++學習之路

原文鏈接:https://blog.csdn.net/ajian005/article/details/8003655

原创 算法之(一)荷蘭國旗問題

通過一次劃分,將數組分爲三部分,前半段爲小於num的數,中間半段爲等於num的數,後半段爲大於num的數 public static void partition(int[] arr, int num) { int less =

原创 java學習之static和final

一、static static變量: 1.1)屬於類,存儲在方法區中,只有一份 1.2)通過類名點來訪問 用途:所有對象所共享的數據(圖片、音頻、視頻等) static方法 1.1)屬於類,存儲在方法區中,只有一份 1.2)通過類名點

原创 算法之(三)和尚挑水問題(回溯法)

題目簡介:寺廟裏7個和尚:輪流挑水,爲了和其他任務不能衝突,各人將有空天數列出如下表: 和尚1: 星期二,四; 和尚2: 星期一,六; 和尚3: 星期三,日; 和尚4: 星期五; 和尚5: 星期一,四,六; 和尚6: 星期二,五; 和

原创 java學習之訪問控制符

一、類的訪問修飾符:只有兩種public和默認 設置爲public,在任何類中都可以import使用 設置爲默認,只可以在同一個包中使用,無法通過import在別的包中使用 二、類成員和方法訪問修飾符 public:哪裏都可以用 pr

原创 Python網絡爬蟲之正則表達式(三)

(一)match()方法 1、最常規的匹配、泛化匹配 import re content = 'Hello 123 4567 World_This is a Regex Demo' result = re.match('^Hello