views:

80

answers:

2

Hello, I wanna find something like linked list but non from generic namespace, is it possible ? Thanks.

A: 

ArrayList is more or less a linked list and is not generic. You can also expose it as IEnumerable (and not IEnumerable) which is in fact the linkedlist interface in terms of iteration.

Aliostad
It isn't really much like a linked list in terms of the performance profile for operations like insert/remove. `ArrayList` maps to `List<T>` only...
Marc Gravell
I need functionality from LinkedList for example native order and other, I cannot use ArrayList.
jitm
@jitm, about the only way that a linked list is like an array list, is maintaining insertion order.
Jon Hanna
+2  A: 

Since you are using .NET 1.x, you would need to either implement this from scratch (which isn't that hard really), or settle for ArrayList. I know the position - for a utility library I ended up writing the list primitives from scratch, because:

  • 1.x lacks the generic versions
  • Silverlight lacks the non-generic versions

so to work on all platforms, I rolled my own (I had other unique features too, which made hacking around with something like a using alias undesirable - such as thread-safe tail-iteration while appending items).

Marc Gravell
may be present some opensource implementation for .net 1.x ?
jitm
@jitm - of a linked list? Most text-book examples would suffice (translated to C#, obviously). My *specific* ones weren't linked list, else you would be more than welcome to them.
Marc Gravell
ok, thanks, starting to read books :)
jitm