avatar
问一道Epic的老题# JobHunting - 待字闺中
w*8
1
Suppose N patients and M diseases. N is sufficiently large number and M is
relatively small, say 30-ish. Each patient can have possible 0 to M kinds of
diseases.
Given one patient’s name, show me a list of similar patients sharing same
deseases within 2-3 seconds.
不是我面的
大概要设计一个什么样的data structure来完成这个需求?
avatar
m*a
2
用bit 来记录M disease
取一个病人,
然后用& 加^来扫描其他病人,如果是0,就是一样的

of

【在 w********8 的大作中提到】
: Suppose N patients and M diseases. N is sufficiently large number and M is
: relatively small, say 30-ish. Each patient can have possible 0 to M kinds of
: diseases.
: Given one patient’s name, show me a list of similar patients sharing same
: deseases within 2-3 seconds.
: 不是我面的
: 大概要设计一个什么样的data structure来完成这个需求?

avatar
w*k
3
1个32bit整数代表这个人患的所有病,作为key来hash,O(1)solution。
avatar
m*a
4
这个咋解决,要查病人1,2,3,一个病人有1,2,3,4
这二个人是相似的

【在 w****k 的大作中提到】
: 1个32bit整数代表这个人患的所有病,作为key来hash,O(1)solution。
avatar
s*3
5
我也被面过这题。。。
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。