private List <int> ConvertLinkedListToList(SwapNodePairsInLinkedList.LinkedListNode node)
        {
            List <int> list = new List <int>();

            while (node != null)
            {
                list.Add(node.Value);
                node = node.Next;
            }

            return(list);
        }
        private SwapNodePairsInLinkedList.LinkedListNode ConvertListToLinkedList(List <int> list)
        {
            SwapNodePairsInLinkedList.LinkedListNode root    = null;
            SwapNodePairsInLinkedList.LinkedListNode current = null;
            foreach (var value in list)
            {
                var newNode = new SwapNodePairsInLinkedList.LinkedListNode(value);

                if (root == null)
                {
                    root    = newNode;
                    current = root;
                    continue;
                }

                current.Next = new SwapNodePairsInLinkedList.LinkedListNode(value);
                current      = current.Next;
            }

            return(root);
        }