Name -> ID 就是 string -> int,字符串最好用 Hash 或 Tree 来索引,不过由于 Name 不是唯一的,一个 Name 可能对应多个 ID,要用 Linked List 做对应过来的结构。所以可以是 Hash + Linked List 或 Tree + Linked List。(Tree 可以用 Trie,复杂度是 O(length(name)),其实 Hash 会更好,理论上复杂度是 O(1))。
ID -> Name 就是 int(7 digit) -> string,7 位数也就是 1000 w,可以开得下(人家机子好),所以就可以随机查了。
Asume you have an object to describe customer data:{ ID(7 digit numeric) Family Name(string) Account
最新推荐文章于 2022-05-19 18:00:36 发布
 Family Name(string) Account&spm=1001.2101.3001.5002&articleId=50850352&d=1&t=3&u=9028bb9011af4e779403da68037a547a)
3万+

被折叠的 条评论
为什么被折叠?



