2015年8月20日21:03:18 firstNotRepeatingChar 哈希表实现O(n)
来源:互联网 发布:转换成淘宝客链接 编辑:程序博客网 时间:2024/06/05 03:58
<pre name="code" class="cpp">//for a char datetype,a 256 array hashtable .//looking for the first ,so wo should keep the sortchar FirstNotRepeatingChar(char* pString){ if(pString == NULL) return '\0'; const int tableSize = 256; unsigned int hashTable[tableSize]; for(unsigned int i = 0; i<tableSize; ++ i) hashTable[i] = 0; char* pHashKey = pString; while(*(pHashKey) != '\0') hashTable[*(pHashKey++)] ++; pHashKey = pString; while(*pHashKey != '\0') { if(hashTable[*pHashKey] == 1) return *pHashKey; pHashKey++; } return '\0';}
0 0
- 2015年8月20日21:03:18 firstNotRepeatingChar 哈希表实现O(n)
- 2015年8月13日 O(n)fibonacci
- 2017年5月21、22日r-u-a-n-k-a-o整理
- js实现yyyy年MM月dd日 星期N
- 未亡羊先补牢-2015年03月18日
- 数据库选取第N到第N+M条记录[2004年7月10日 20:03]
- 8月21日.
- 8月18日
- 8月20日
- 8月20日
- 2017年9月21日20:49:18
- 2015年03月20日 算法第一天札记
- 2015年3月20/21日产品研讨会总结
- 2017年8月18日15:20:10
- 2015年8月20日17:15:53
- 2015年8月30日17:20:36
- 2008年03月21日
- 2012年03月21日
- filter2D函数
- inf
- 电脑反应慢的原因
- 拆分整数
- Hibernate 所有缓存机制详解
- 2015年8月20日21:03:18 firstNotRepeatingChar 哈希表实现O(n)
- android 添加视频、图片、录音上传(二)
- 第90讲:基于Scala的Actor之上的分布式并发消息驱动框架Akka初体验学习笔记
- mapreduce查询mysql表中记录数
- POJ 题目3237 Tree(Link Cut Tree边权变相反数,求两点最大值)
- 排序算法(Java语言)——希尔排序
- studio 2010快捷键
- 强名称程序集(strong name assembly)——为程序集赋予强名称
- Perfection