KMP 字串搜尋KMP (Knuth–Morris–Pratt) 字串搜索,對於長度 n 的本文和長度 m 的模式,時間複雜度為 O(m+n)。KMP 算法核心在於利用模式的前綴 (prefix),以及匹配過的本文後綴(suffix),跳過不必要的嘗試,以節省搜尋時間。KM P…Mar 23, 2018Mar 23, 2018
[distcc] Using ccache on distcc serverBuilding large c-family project (C, C++, Object-C, etc) can be very slow due to long compiling time. There are simple way to improve…Feb 10, 20182Feb 10, 20182
[Linux] SSH command using with environment variablesWhen we run a shell script on remote machine over SSH, the script might fail because it depends on unset environment variables. For…Feb 10, 2018Feb 10, 2018