Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Data structures 用于维护大型别名集以便快速查找的数据结构_Data Structures - Fatal编程技术网

Data structures 用于维护大型别名集以便快速查找的数据结构

Data structures 用于维护大型别名集以便快速查找的数据结构,data-structures,Data Structures,我有一个列表(>50000字)。列表中的每个单词都有一组关联的别名。每个词平均有5个别名 我得到一个平均为6个单词的输入字符串。我必须做: // Pseudocode foreach word in input_string if word == x or word in alias(x) // x is a word in the list tag (word, x) // Tag word with x else tag (word, 0

我有一个列表(>50000字)。列表中的每个单词都有一组关联的别名。每个词平均有5个别名

我得到一个平均为6个单词的输入字符串。我必须做:

// Pseudocode 
foreach word in input_string
    if word == x  or  word in alias(x) // x is a word in the list
       tag (word, x)  // Tag word with x
    else 
       tag (word, 0)
end
什么是维护别名列表的快速数据结构,可以快速执行上述查找

使用O(n/k)或O(logn)查找将是合适的

例子包括:

  • );或

您是否有任何空间限制?如果不是的话,一个简单的字典/hashmap将为您提供良好的查找性能。在这种查找中,各种数据结构的比较统计数据是什么?