Esempio n. 1
0
        private static void Push(int newData, LinkedListNode.Node head)
        {
            var newNode = new LinkedListNode.Node(newData);

            newNode.next = head;
            head         = newNode;
        }
Esempio n. 2
0
 private static void PrintList(LinkedListNode.Node node)
 {
     while (node != null)
     {
         Console.WriteLine($"Nó: {node.data} ");
         node = node.next;
     }
 }
Esempio n. 3
0
        private static void LinkedList()
        {
            var linkedList = new LinkedListNode();

            linkedList.head = new LinkedListNode.Node(1);
            LinkedListNode.Node second = new LinkedListNode.Node(2);
            LinkedListNode.Node third  = new LinkedListNode.Node(3);

            linkedList.head.next = second;
            second.next          = third;

            PrintList(linkedList.head);
            Push(4, linkedList.head);

            LinkedListTest.PrintActions();
        }