可用于查找可以使用不同类型的多个键标识的值的数据结构
例如,考虑医院记录的存储。如果约翰·史密斯感觉不舒服,医生可能需要按姓名查找他的记录以查找他的病史。然而,医生可能还需要查找所有经历过约翰所经历症状的患者,以帮助诊断。在另一种情况下,他可能需要一份在某个时间入院的所有患者的名单。将使用什么数据结构来存储患者记录并根据姓名、症状、入院日期以及可能的其他标识符搜索它们?
As an example, consider the storage of hospital records. If John Smith is feeling sick, the doctor might need to look up his record by name to find his medical history. However, the doctor might also need to lookup all patients who experienced the symptoms John experienced to help the diagnosis. In another case, he may need a list of all patients admitted to the hospital at a certain time. What data structure(s) would be used to store patient records and search for them based on name, symptom, date of admission, and possibly other identifiers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将把它扔在那里:这读起来就像关系数据库的用例。也许将数据存储在数据库中并通过查询访问它是一个很好的长期解决方案?如果你对理论/算法感兴趣,你可以研究数据库如何解决这些问题。索引、查询优化等内容非常深入,可能无法在这里进行有意义的讨论。
I'll throw this out there: this reads like the use-case for a relational database. Perhaps storing the data in a database and accessing it with queries is a good, long-term solution? If you're interested in the theory/algorithms, you can study how databases solve these problems. Things like indexes, query optimization, etc. are quite deep and probably can't be meaningfully covered here.