I'm building an app in C#, however I'm new to the language though its pretty easy to learn because its too damn similar to Java.
However, I'm getting lost with the data structures as I haven't found a list of comprehensive available data structures with their methods like how Java has them.
Anyone has a reference list of available data structs for C# and their methods?
Most of the data structures you'll use in C# are contained in the System.Collections.Generic namespace. There are some rarely used data structures in the System.Collections.Specialized namespace. Also, there are some older, non-generic versions of data structures that are mostly deprecated since the introduction of generics in C# 2.0 available in the System.Collections namespace.
Scott Mitchell has a nice introductory article set about some data structures in .NET: An Extensive Examination of Data Structures Using C# 2.0.
If you're coming from a Java background, you'll notice that unlike Java, .NET data structures are named after their function, not the way they are implemented.
You're going to love them. C# data structures combined with LINQ offer so much more than Java. Check out the System.Collections.Generic namespace. One important note that almost any generic collection implements the IEnumerable<T> interface one way or other and you can LINQ to any IEnumerable<T> object:
List<SomeClass> yourList = new List<SomeClass>();
// Add elements ...
var redElementsOnly = yourList.Where(e => e.IsRed);
Check out the System.Linq.Enumerable class for a complete list of what LINQ can do for you.
You may find these MSDN pages useful: The C# Programming Language for Java Developers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With