简体   繁体   English

C#中TreeBidiMap的等价物是什么?

[英]What is the equivalent of TreeBidiMap in C#?

What is equivalent to [TreeBidiMap][1] in c# from Commons Collections in Java?什么相当于 Java 中Commons Collections中 c# 中的[TreeBidiMap][1]

BidiMap is an interface which defines map which allows mapping from key to value as well as from value to key (thus "bidirectional"). BidiMap是一个定义 map 的接口,它允许从键到值以及从值到键的映射(因此是“双向的”)。 TreeBidiMap is the implementation of this interfaces which uses red-black tree. TreeBidiMap是这个接口的实现,它使用红黑树。

None of this classes exist in .NET BCL per se, but I think those can be composed out of simpler primitives. .NET BCL 本身中不存在这些类,但我认为这些类可以由更简单的原语组成。 Specifically, C5 Generic Collection Library provides an implementation of a red-black tree, and bidirectional map can be implemented on top of a standard Dictionary<TKey, TValue> .具体来说, C5 通用集合库提供了红黑树的实现,双向 map 可以在标准Dictionary<TKey, TValue>之上实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM