tags:

views:

714

answers:

4

Hi, I'm learning c# , and I reached the LinkedList<T> type and I still need to know more, like when should I use it, how do I create one, how do I to use it. I just want information.

If any one knows a good article about this subject, or if you can show me some examples with explanation, such as how to create, how to add and remove, and how to deal with nodes and elements.

Thanks in advance. I really enjoy asking questions around here with all the pros answering and helping.

[EDIT] Changed reference to LinkedList<T> instead of "array linkedlist." I think this was what was meant based on the context.

+2  A: 

You can find more information on LinkedList<T> at MSDN, including an example of how to create and use one. Wikipedia has a reasonable article on linked lists, including their history, usage, and some implementation details.

tvanfosson
A: 

Do you know what a standard Linked List is? It's like one of those (doubly linked) but using .NET Generics to allow you to easily store any Type inside of it.

Honestly, I don't use it, I prefer the more basic List or Dictionary.

For more info on Linked Lists, check out wikipedia. As for generics, there are tons of articles here and at MSDN.

swilliams
A: 

linklist are collections.. they can be use as replacements for arrays.. they can dynamically grow in size and has special helper methods that can help the development or the problem solving be faster.. try to view its methods and properties to understand more.

linklist is a generic collection.. meaning can used to declare type safety declarations..

Aristotle Ucab
You shouldn't use a linked list in place of an array; it has different performance characteristics (e.g. O(N) lookup and insertion) versus the standard vector (List in .NET, ArrayList in Java); it isn't a drop-in replacement for an array.
Rob
A: 

Linked is a collection to store sequences of values of the same type, which is a frequent task, e.g. to represent a queue of cars waiting at a stoplight.

There are many different collection types like linked list, array, map, set etc. Which one to use when depends on their properties, e.g.:

  • do you need some type of ordering?
  • is the container associative, storing key-value pairs like a dictionary?
  • can you store the same element twice?
  • performance measures - how fast is e.g. inserting, removing, finding an element? This is usually given in Big-O notation, telling you how the time required scales with the number of elements in the collection.
  • Memory footprint and layout. This also can affect performance, due to good/bad locality.
peterchen