Linked list in C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi i need to use a linked list in C# for my application.In this linked list
each node will be able to have more than one child node.Waht type of linked
list would you suggest?

Note:I am novice in C# so could you describe the code (accessing the nodes,
addind neew nodes etc.)
 
panda said:
Hi i need to use a linked list in C# for my application.In this linked list
each node will be able to have more than one child node.Waht type of linked
list would you suggest?

Note:I am novice in C# so could you describe the code (accessing the nodes,
addind neew nodes etc.)

Linked lists just don't have more than one child node - it sounds like
what you want is actually a tree. I'm sure there are some tree
collections available on the web.

http://www.codeproject.com/csharp/trees.asp has one for C# 2.0, but it
could probably be changed to a non-generic version fairly easily.
 
Hi i need to use a linked list in C# for my application.In this linked list
each node will be able to have more than one child node.Waht type of linked
list would you suggest?

You could have a look at ArrayList - it's a list of arbitrary objects.
If you need more than one object per node, you could make your node an
ArrayList again - works fine for me.

Marc

================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
 
Jon Skeet said:
Linked lists just don't have more than one child node - it sounds like
what you want is actually a tree. I'm sure there are some tree
collections available on the web.

http://www.codeproject.com/csharp/trees.asp has one for C# 2.0, but it
could probably be changed to a non-generic version fairly easily.

sorry i should have said tree and not "more than one child" it must have
more than two child.

actually i need to create a data type like treeview logically
 
Back
Top