我需要的方法只是添加()和 IndexOf ()
谢谢
解决方案我使用了一个很好的红黑树实现,并实现了我自己的订单统计树。它是一个通用DS。 由于它没有框架DS的所有通用属性,它的工作速度比我的特定问题快5倍。
I need a Fast Order Statistic Tree in my C# code. The only data structure I know that has IndexOf() method and keeps items sorted is SortedList. Unfortunately, its insertion complexity is O(n) unlike SortedDictionary that is O(Lg n) but SortedDictionary does not have IndexOf().
The methods I need are just Add() and IndexOf()
Thanks
解决方案I have used a nice implementation of Red-black tree and implemented my own Order Statistic Tree. It is a generic DS. As it does not have all general purpose properties of framework DSs it works 5 times faster for my specific problem.