Wilson HongKMP 字串搜尋KMP (Knuth–Morris–Pratt) 字串搜索,對於長度 n 的本文和長度 m 的模式,時間複雜度為 O(m+n)。KMP 算法核心在於利用模式的前綴 (prefix),以及匹配過的本文後綴(suffix),跳過不必要的嘗試,以節省搜尋時間。KM P…Mar 23, 2018Mar 23, 2018
Wilson HongSmallest Enclosing Circle 最小覆蓋圓最小覆蓋圓 :平面上給定 n 個點,求出能包含所有點且半徑最小的圓。Feb 18, 20181Feb 18, 20181
Wilson Hong[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
Wilson Hong[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