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.
我正在学习c#,并且我达到了LinkedList
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.
[编辑]更改了对LinkedList
5 个解决方案
#1
4
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.
您可以在MSDN上找到有关LinkedList
#2
3
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.
Linked是用于存储相同类型的值序列的集合,这是一个常见的任务,例如,代表在红绿灯处等待的汽车队列。
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.
你需要某种类型的订购吗?
是容器关联,存储像字典一样的键值对?
你可以存储两次相同的元素吗?
绩效衡量标准 - 例如多快插入,删除,找到一个元素?这通常以Big-O表示法给出,告诉您所需时间如何随着集合中元素的数量而变化。
内存占用和布局。由于好/坏的局部性,这也会影响性能。
#3
1
This collection class implements a doubly linked list. It allows you to quickly determine the immediate sibling for a specified item in the collection. Removing an item from the collection automatically resizes it so that it does not leave any gaps.
此集合类实现双向链表。它允许您快速确定集合中指定项目的直接兄弟。从集合中删除项目会自动调整其大小,以便不会留下任何空白。
For more info on LinkedList class, check out LinkedList at MSDN.
有关LinkedList类的更多信息,请查看MSDN上的LinkedList。
#4
0
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.
你知道标准的链表是什么吗?它就像其中一个(双重链接)但使用.NET Generics允许您轻松地在其中存储任何类型。
Honestly, I don't use it, I prefer the more basic List or Dictionary.
老实说,我不使用它,我更喜欢更基本的List或Dictionary。
For more info on Linked Lists, check out wikipedia. As for generics, there are tons of articles here and at MSDN.
有关链接列表的更多信息,请查看*。至于泛型,这里有很多文章和MSDN。
#5
0
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是集合..它们可以用作数组的替代品。它们可以动态增长,并且具有特殊的帮助方法,可以帮助开发或解决问题更快..尝试查看其方法和属性以了解更多。
linklist is a generic collection.. meaning can used to declare type safety declarations..
linklist是一个通用集合。意思是可以用来声明类型安全声明..
#1
4
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.
您可以在MSDN上找到有关LinkedList
#2
3
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.
Linked是用于存储相同类型的值序列的集合,这是一个常见的任务,例如,代表在红绿灯处等待的汽车队列。
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.
你需要某种类型的订购吗?
是容器关联,存储像字典一样的键值对?
你可以存储两次相同的元素吗?
绩效衡量标准 - 例如多快插入,删除,找到一个元素?这通常以Big-O表示法给出,告诉您所需时间如何随着集合中元素的数量而变化。
内存占用和布局。由于好/坏的局部性,这也会影响性能。
#3
1
This collection class implements a doubly linked list. It allows you to quickly determine the immediate sibling for a specified item in the collection. Removing an item from the collection automatically resizes it so that it does not leave any gaps.
此集合类实现双向链表。它允许您快速确定集合中指定项目的直接兄弟。从集合中删除项目会自动调整其大小,以便不会留下任何空白。
For more info on LinkedList class, check out LinkedList at MSDN.
有关LinkedList类的更多信息,请查看MSDN上的LinkedList。
#4
0
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.
你知道标准的链表是什么吗?它就像其中一个(双重链接)但使用.NET Generics允许您轻松地在其中存储任何类型。
Honestly, I don't use it, I prefer the more basic List or Dictionary.
老实说,我不使用它,我更喜欢更基本的List或Dictionary。
For more info on Linked Lists, check out wikipedia. As for generics, there are tons of articles here and at MSDN.
有关链接列表的更多信息,请查看*。至于泛型,这里有很多文章和MSDN。
#5
0
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是集合..它们可以用作数组的替代品。它们可以动态增长,并且具有特殊的帮助方法,可以帮助开发或解决问题更快..尝试查看其方法和属性以了解更多。
linklist is a generic collection.. meaning can used to declare type safety declarations..
linklist是一个通用集合。意思是可以用来声明类型安全声明..