What is equivalent to [TreeBidiMap][1]
in c# from Commons Collections in Java?
Asked
Active
Viewed 402 times
0

Litisqe Kumar
- 2,512
- 4
- 26
- 40

Mponnada
- 263
- 5
- 18
-
Duplicate of http://stackoverflow.com/questions/268321/bidirectional-1-to-1-dictionary-in-c – ShuggyCoUk Feb 24 '09 at 13:42
-
It has an answer for you too :) – ShuggyCoUk Feb 24 '09 at 13:43
1 Answers
0
BidiMap
is an interface which defines map which allows mapping from key to value as well as from value to key (thus "bidirectional"). TreeBidiMap
is the implementation of this interfaces which uses red-black tree.
None of this classes exist in .NET BCL per se, but I think those can be composed out of simpler primitives. 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>
.

Anton Gogolev
- 113,561
- 39
- 200
- 288