Question:

How we can use linked-list in c#?

by  |  earlier

0 LIKES UnLike

this is the question of data structure

 Tags:

   Report

3 ANSWERS


  1. To instantiate a new linked list you must declare a type of LinkedList and construct the new object. For example, to declare and instantiate the LinkedList object MyList we would have the following code:

    public static LinkedList MyList = new LinkedList();

    Nodes are part of the list therefore we must instantiate a new node with the following code:

    public static LlNode MyNode = new LlNode();

    for a complete info on linked list just follow this link

    http://www.codersource.net/csharp_linked...


  2. With respect, sir, I admire greatly your knowledge, but maybe the question belongs in "mat" or "stats" or even "homework" if you want expert answers?

  3. This is a computer science/programming question.  Since this is the languages section, I doubt you will get any expert advice.

    I only remember doing linked-lists in C using structs.  Linked-lists can be used to implement certain tree structures.  If those trees run in binary time, big-O( log(n) ), they can be quite efficient compared to other sorting or storage methods.

    I also remember using linked-lists to implement Stacks and Queues.

    The declaration of each node looks something like this:

    struct node

    {

    int x;  //whatever data needs to be recorded for each node

    node *nxt; // Pointer to next node

    };

    Check this page out; see if it helps:

    http://richardbowles.tripod.com/cpp/link...

    Applications of Linked-Lists:

    http://en.wikipedia.org/wiki/Linked_list...

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.