Roger
Roger

Reputation: 31

VB.NET equivalent to java.util.TreeSet

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

Upvotes: 3

Views: 2679

Answers (3)

Paul Sasik
Paul Sasik

Reputation: 81507

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.

Upvotes: 2

Juliet
Juliet

Reputation: 81526

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

Upvotes: 2

LukeH
LukeH

Reputation: 269528

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.

Upvotes: 1

Related Questions