views:

396

answers:

3

This may be a silly question (with MSDN and all), but maybe some of you will be able to help me sift through amazing amounts of information.

I need to know the specifics of the implementations of common data structures and algorithms in C#. That is, for example, I need to know, say, how Linked Lists are handled and represented, how they and their methods are defined.

Is there a good centralized source of documentation for this (with code), or should I just reconstruct it? Have you ever had to know the specifics of these things to decide what to use?

Regards, and thanks.

+4  A: 

Scott Mitchell has a great 6-part article that covers many .NET data structures:

An Extensive Examination of Data Structures

For an algorithmic overview of data structures, I suggest reading the algorithm textbook: "Introduction to Algorithms" by Cormen, et al..

For details on each .NET data structure the MSDN page on that specific class is good.

When all of them fail to address issues, Reflector is always there. You can use it to dig through the actual source and see things for yourself.

Mehrdad Afshari
Great answer, Mehrdad. Thanks. And thanks also for the clarification on my comment to samoz.
Dervin Thunk
+1  A: 

If you really want to learn it, try making your own.

Googling for linked lists will give you a lot of hits and sample code to go off of. Wikipedia will also be a good resource.

samoz
This is not a bad idea... but I was wondering maybe C# ahs optimizations I could never implement without really knowing, say, CLI or something like that, and I don't have time to go into too much detail.
Dervin Thunk
@Dervin: I don't think collection classes have any specific optimization at the CIL level. However, internally, the runtime can treat some classes in special ways. For instance, I think `List<T>` actions are optimized by the runtime.
Mehrdad Afshari
A: 

Could you describe the reason that you need to know this information, as that could be very important when determining how to respond and how much detail to provide.

Not really. The question is simple: where do I get the source implementation of the diff data structures used in C#.
Dervin Thunk