tags:

views:

225

answers:

3

Is there a VB.NET equivalent to java.util.TreeSet?

A: 

Strangely, the .NET FCL does not include tree-bases data structures/collections. You can implement your own though. See here for a C# example (easy enough to convert to VB.NET)

The C5 Library is a well-regarded project that:

... provides the following data structures, described by C# classes: array list, doubly linked list, hash-indexed array list, hash-indexed linked list, hash set, hash bag (multiset), sorted array, wrapped array, tree set, tree bag (multiset), stack, double-ended queue, circular queue, priority queue (interval heap), hash dictionary, and tree dictionary.

C5 is also C#-based but it does come as a DLL so you wouldn't even have to worry about the language. Just reference it in your solution and off you go.

Paul Sasik
A: 

There's nothing built-in, but you could use the TreeSet<T> implementation from the C5 library. This sounds as though it's roughly equivalent, although I haven't used it myself.

LukeH
A: 

The closest you'll find is the SortedSet(T) class.

Juliet
...if you're using .NET4.
LukeH