Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/algorithm/12.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
Algorithm 谁能想到一种算法,它使用跳过列表搜索元素,但在O(log(k))中找到它,其中k是元素索引?_Algorithm_Search_Time Complexity_Skip Lists - Fatal编程技术网

Algorithm 谁能想到一种算法,它使用跳过列表搜索元素,但在O(log(k))中找到它,其中k是元素索引?

Algorithm 谁能想到一种算法,它使用跳过列表搜索元素,但在O(log(k))中找到它,其中k是元素索引?,algorithm,search,time-complexity,skip-lists,Algorithm,Search,Time Complexity,Skip Lists,如上所述。我试图想出一种算法,使用跳过列表搜索元素,其中n元素。但是,我不想在O(log(n))中找到它,而是想在O(log(k))中找到它,其中k是所需元素的索引 有什么建议吗?使用哈希映射很快不允许使用哈希映射…………为什么?我们在学习如何使用哈希映射之前就被问到了这个问题,因此,不允许使用它们。@KamilKiełczewski我称之为BS。在查找集合中第k个最大元素时,哈希映射比跳过列表慢得多。事实上,为了达到这个目的,哈希映射实际上比无序数组更糟糕,因为在它上面迭代更复杂!

如上所述。我试图想出一种算法,使用跳过列表搜索元素,其中
n
元素。但是,我不想在
O(log(n))
中找到它,而是想在
O(log(k))
中找到它,其中
k
是所需元素的索引


有什么建议吗?

使用哈希映射很快不允许使用哈希映射…………为什么?我们在学习如何使用哈希映射之前就被问到了这个问题,因此,不允许使用它们。@KamilKiełczewski我称之为BS。在查找集合中第
k
个最大元素时,哈希映射比跳过列表慢得多。事实上,为了达到这个目的,哈希映射实际上比无序数组更糟糕,因为在它上面迭代更复杂!