主题:求教大家一个算法问题 -- looklook
There are lots of variation of the classic issue.
One variation is: there is a character sequence composed of 26 English alphabets: a-z, assuming all lower case. How to find the duplicate character in the sequence if there is any?
The solution is to use an array of 26 to hold a-z. If there is an array element being written twice, then that\'s the duplicate.
As a matter of fact, this is one of the questions in a Microsoft interview.
bigbug
- 相关回复 上下关系8
压缩 2 层
🙂这就相当于SQL中最常用的方法啊,select *,count(*) as N having N=2; wsxx 字0 2006-05-18 02:31:11
🙂這不是pigeon hole sorting的算法嗎:) 1 wildpig 字0 2006-05-06 02:37:29
🙂这是个经典题目, 答案的确如此。原题是这样的: 1 萝卜酒 字122 2006-05-06 01:11:16
🙂Variation of the classic issue.
🙂not the most efficient method 小章 字397 2006-05-13 15:06:12
🙂Yes, it's the solution for Microsoft interview question. bigbug 字126 2006-05-20 01:38:24
🙂这恐怕不能称为是一种hash方法 2 aniu 字418 2006-05-06 00:46:43
🙂这个我也想过的,但是这个方法只限于整数 1 【子衿】 字108 2006-05-05 23:36:53