作者yaote (ted)
看板Programming
标题[问题] 演算法
时间Sat Jan 13 11:16:10 2007
以下是一所国外研究所的考试题目,是否能用程式跟图解来解答这个问题?
I have a computer file containing 1,000,000 non-negative integers,
in no particular order. Imagine that they are the membership numbers of
people who are enrolled in my internet club. A new person wants to join
the club, and we need to find an unused number to allocate to them. How
would you find, in a reasonable time, a number that was not already in the
file?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.140.56.26
1F:推 march20:全部加起来一定没问题 XD 71.136.235.216 01/13 11:58
2F:推 march20:如果只需要一次的话. 71.136.235.216 01/13 11:59
3F:推 march20:不然长远来看, 用些资料结构来放会比较赚 71.136.235.216 01/13 11:59
4F:推 march20:喔, 为了避免 0 的问题, sum 完後再加1 71.136.235.216 01/13 12:07
※ yaote:转录至看板 C_and_CPP 01/13 18:59