c#结构,如std::set,支持lower_bound
C# structure like std::set that supports lower_bound
我需要一个内置的数据结构在C#
具有类似于std::set
(或std::map
)在c++中的功能。对我来说重要的是,结构应该排序(因此Dictionary
不会在这里做),并有一个类似于lower_bound
的方法(即返回值至少为v
的第一个元素)。我还需要从结构中插入和删除元素。如果可能的话,我需要这些操作的复杂度为O(log(n))
。您能告诉我C#
中合适的数据结构吗?
我怀疑您正在寻找与std::set类似的数据结构的SortedSet。
本文探讨其性能特点。
lower_bound
功能似乎可以使用SortedSet。GetViewBetween的复杂度比期望的O(log(n))要低
相关文章:
- 空集"Out of bound iterator"
- 将张量的"lower diagonal"映射到矩阵,作为将矩阵的下三角形部分提取到向量的推广
- 为什么<<低;和 cout<<v.begin;单独给出错误,但 cout <<(lower.begin());没有给出任何错误,并使代码易于编译
- 使用多个文件时"array bound is not an integer constant before ']' token"
- "A reference may be bound only to an object",为什么"const int &ref = 3;"有效?
- 如何修复"reference cannot be bound to dereferenced null pointer"警告
- 当你有一个像 ::lower 这样的参数时,这在C++中是什么意思
- GCC 检测"subindex out of bound"错误
- 如果我没有得到分段错误,如何找到"index out of bound"
- 一个程序将字符串Upper char更改为Lower char得到错误
- std:: lower的行为在不同的语言环境中是如何变化的?
- 在main中声明Array之前,Array bound不是整型常量
- 获取错误"array bound is not an integer constant before ']' token"
- 如何在C或c++中获得与Java中的toLowerCase或Python中的string.lower()相同的结果
- 在运行时创建结构时"array bound is not an integer constant"