C# singly linked list implementation

后端 未结 4 1341
闹比i
闹比i 2021-02-06 08:48

While trying to understand how a singly list can be implemented in C#, I came across the link below :

Creating a very simple linked list.

However, as I am new to

4条回答
  •  执念已碎
    2021-02-06 09:42

    Remember that a Linked-List not only holds data, but a reference / pointer to the next node in the list. Since classes are reference types in C#, you don't see any special syntax that you would otherwise see in C or C++.

    struct Node
    {
        int Number;
        struct Node* next; /* this points to the next node in the linked list */
    };
    

提交回复
热议问题