473,772 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why no LinkedList?

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 new
element you just create this objekt and set a reference in contrast to an
arraylist where you have to copy the whole array and create a new one with
the double size.

Additionally removing elements in an ArrayList is a very expensive
operation: all elements behind the removed element has to be copied to fill
the hole. With LinkedList you just have to relink to element to remove
everything between them.

I was hoping that Whidbey would provide a LinkedList but I looked in the
beta and there was nothing.

So what are the reasons behind this decision?

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk
Nov 22 '05 #1
1 1889
Cody:

Behind the scenes they are used all over the place in .NET and you can
easily code one yourself. Back in the old days of C++ I had to write my own
so I did the same in C# just for fun. If you search google for Linked LIst
C# there are hundreds of examples...
http://csharpcomputing.com/Tutorials/Lesson9.htm

Maybe I"m missing your point with ArrayLists though...they don't necessitate
the use of an Array at all, so I'm probably misunderstandin g your point.
Can you explain that part a little more b/c I don't think I follow you.
"cody" <pl************ *************@g mx.de> wrote in message
news:#c******** ******@TK2MSFTN GP11.phx.gbl...
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 new
element you just create this objekt and set a reference in contrast to an
arraylist where you have to copy the whole array and create a new one with
the double size.

Additionally removing elements in an ArrayList is a very expensive
operation: all elements behind the removed element has to be copied to fill the hole. With LinkedList you just have to relink to element to remove
everything between them.

I was hoping that Whidbey would provide a LinkedList but I looked in the
beta and there was nothing.

So what are the reasons behind this decision?

--
cody

[Freeware, Games and Humor]
www.deutronium.de.vu || www.deutronium.tk

Nov 22 '05 #2

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

Similar topics

8
3077
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 explain to me how I create a list and traverse it? In particular, how do I make use of the node.h method GetNext()? I don;t know what to do with it.
2
9110
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 be exposed publically without violating encapsulation of the class. If I make the class derive from ISerializable and IDeserializationCallback, I can attempt to "forward" these methods onto the linked list. For example (assuming _list is our...
6
1567
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 of it. Then I wrote a method called public sub MySortProcedure (byref list as LinkedList(Of Orderable)) but I cannot pass in my list of objects derived from it which were originally declared like this:
3
4207
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 item; private ListNode next,head; public ListNode(Object newItem) { item = newItem; next = null; } public ListNode(Object newItem, ListNode newNext) { item = newItem; next = newNext; } public void...
1
1963
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 list. It keeps returning null. Hope that helps! Thanks! Heres the code: /** Casey Holgado Computer Science 4 Period 2 02/19/08 */ import java.util.*;
0
9619
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9911
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.