Check out example codes for "create and return linked list c#". It will help you in understanding the concepts better.

Code Example 1

public class Node
    {
        public int data;
        public Node next;

        public Node(int data)
        {
            this.data = data;
        }
    }

	class Program
    {
        private static void Main(string[] args)
        {
            Node head = new Node(4);
            Node nodeB = new Node(2);
            Node nodeC = new Node(3);
            Node nodeD = new Node(10);

            head.next = nodeB;
            nodeB.next = nodeC;
            nodeC.next = nodeD;
            Console.WriteLine(countNodes(head));
        }

        static int countNodes(Node head)
        {
            int count = 1;
            Node current = head;

            while (current.next != null)
            {
                current = current.next;
                count += 1;
            }
            return count;
        }

Learn ReactJs, React Native from akashmittal.com