Example #1
0
        public static ListNode GetReverseList(ListNode node)
        {
            var revList = new LinkedList();

            foreach (var value in GetNodeValues(node))
            {
                revList.AddBegin(new ListNode(value));
                node = node.next;
            }

            return(revList.First);
        }