Beispiel #1
0
        public static void TestLinkedList()
        {
            LinkedList myLinkedList = new LinkedList();
            ListNode head = myLinkedList.CreateLinkedList(new int[] { 1, 2, 3, 4, 5, 6, 7, 8 });
            head = myLinkedList.ReverseLinkedList_Iterative(head);
            head = myLinkedList.ReverseLinkedList_Recursive_TopDown(head);
            head = myLinkedList.ReverseLinkedList_Recursive_BottomUp(head);

            ListNode newHead = myLinkedList.DeleteGivenValue_Iterative(head, 2);
            
            ListNode nodeDeleted = head.next.next.next.next.next.next.next;
            myLinkedList.DeleteGivenNode(nodeDeleted);
        }