两个很有趣的函数,
Soundex(string),
rules on: http://en.wikipedia.org/wiki/Soundex
会将一串字串依英文读音换成拼写形式,规则比较有趣,KNUTH的书…我就先不去挖了
Width_bucket(x,min,max,num_bucket),
将范围(min,max)分为num_bucket节,每节有相同大小。返回x所在的那节。
1 2 3 4 5 6 7 8 |
If (x< min), return 0; else if (x >=max); return num_buckets+1; // min, max cannot be NULL, // num_buckets must be Positive Integer. // if x=NULL, return NULL |