有什么方法可以通过c#中的SortedDictionary向后(反向)迭代?
或者有没有办法以降序开始定义SortedDictionary?
我使用SortedDictionary来存储按整数排序的值.
我需要在特定的现有整数后得到下一个值.我更喜欢使用枚举器,但没有GetEnumerator(Key k)或类似的功能.
SortedDictionary<int, MyClass> _dict;
void GetNextValue(int start, out MyClass ret)
{
}
Run Code Online (Sandbox Code Playgroud)