摘要:
在字符串中找出第一个只出现一次的字符。(35)对公司员工的年龄进行统计排序。计数排序(适用于有边界的数值统计)。1、思路: 因为字符只有256个数字,设置一个hashtable只有256*4=1K字节,这样时间复杂度只有O(n)。 FirstNotRepeatingChar 1 char FirstNotRepeatingChar(char* pString) 2 { 3 if(pString == NULL) 4 return '\0'; 5 6 const int tableSize = 256; 7 unsigned int hashTable... 阅读全文
posted @ 2013-03-27 14:41
月moon鸟
阅读(189)
评论(0)
推荐(0)

浙公网安备 33010602011771号