473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why is LinkedList lacking so much?

I just realized that I need elements in my List<> to be doubly linked. So I
searched for "C# Linked List" and found the LinkedList<> class. I was happy
until I looked at the docs for this class and realized that it's missing so
much. For example, Find(predicate), operator[], etc

Is there a reason for this other than MS didn't have time to add some of the
nice stuff from list<> to LinkedList<> or am I missing something?

I will just handle the links myself by changing my class to have a previous
and next reference, but what a shame.
May 31 '06 #1
2 1578
Steve,

You could always use a List<T> in a linked list. Granted, the
performance profiles are different for certain operations, but if it suits
your needs, and the performance is acceptable, then by all means, use a
List.

You might also find some open source implementations of a doubly linked
list out there as well.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steve" <sk**@skle.com> wrote in message
news:Om**************@TK2MSFTNGP05.phx.gbl...
I just realized that I need elements in my List<> to be doubly linked. So
I searched for "C# Linked List" and found the LinkedList<> class. I was
happy until I looked at the docs for this class and realized that it's
missing so much. For example, Find(predicate), operator[], etc

Is there a reason for this other than MS didn't have time to add some of
the nice stuff from list<> to LinkedList<> or am I missing something?

I will just handle the links myself by changing my class to have a
previous and next reference, but what a shame.

Jun 1 '06 #2
Thanks Nicholas,

I guess I was just mostly confused why LinkedList<> didn't have operator[]
as this would make my change from a List<> to a LinkedList<> quite involved.

I will check out CodeProject and see what they have ;)
Have a good weekend,
Steve

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Of**************@TK2MSFTNGP03.phx.gbl...
Steve,

You could always use a List<T> in a linked list. Granted, the
performance profiles are different for certain operations, but if it suits
your needs, and the performance is acceptable, then by all means, use a
List.

You might also find some open source implementations of a doubly linked
list out there as well.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Steve" <sk**@skle.com> wrote in message
news:Om**************@TK2MSFTNGP05.phx.gbl...
I just realized that I need elements in my List<> to be doubly linked. So
I searched for "C# Linked List" and found the LinkedList<> class. I was
happy until I looked at the docs for this class and realized that it's
missing so much. For example, Find(predicate), operator[], etc

Is there a reason for this other than MS didn't have time to add some of
the nice stuff from list<> to LinkedList<> or am I missing something?

I will just handle the links myself by changing my class to have a
previous and next reference, but what a shame.


Jun 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: J Peterman | last post by:
Im having a nightmare trying to understand these nodes and linked lists. I've posted my code for my node.h, node.cpp, linkedlist.h and linkedlist.cpp files in separates replies. Can someone...
10
by: cody | last post by:
Why isn't there a LinkedList in .NET? Was the reason that the mark&sweep GC algorithm has problems with heavily linked data? A LinkedList is very important is you have huge lists and append a...
10
by: LP | last post by:
Hi, I was asked at the tech screening what the linked list was which I answered with "academic" definition. Then a guy asked me how I would implement a linked list in C# and what would be a good...
2
by: Justin Crites | last post by:
I have an object which I want to be serializable. I have marked with with . The object only has a single data member, which is a LinkedList<int>. This linked list is a private member and cannot...
6
by: Phillip.Ross.Taylor | last post by:
When I designed my application I created an object called "Orderable" which exposes a public property "sequence". Then a few objects inherit from this. I'll just call them ObjectX for the sake...
3
by: huiling25 | last post by:
I don't know why the customer records cannot be inserted into the linked list and the head of the linked list keep pointing to null... //ListNode.java public class ListNode{ private Object...
1
by: sejong510 | last post by:
MSDN has an example of creating a LinkedList populated with String objects: http://msdn2.microsoft.com/en-us/library/he2s3bh7.aspx But, how would you have a LinkedList of a created class?...
1
by: CaseySimplified | last post by:
I am writing a LinkedList class from scratch without using the already defined LinkedList class. The only thing that doesn't seem to be working is adding removing and getting the last link in the...
5
by: Alberto Bencivenni | last post by:
Hi All, Is there a reason why it is not possible to serialize a geenric LinkedList<Tobject containing a custom class marke serializable? Thanks, Alberto
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.