public static void Main() { //var a = ChampagneTower(2, 0, 0); var numSquares = NumSquares(5); //var numSquares = CountPrimes(16); //var nums = new[] { 1, 3, 4, 2, 2 }; //var findDuplicate = FindDuplicate(nums); //var uniqueNum = MissingNumber(nums); var list1 = new ListNode(1); list1.next = new ListNode(3); list1.next.next = new ListNode(4); list1.next.next.next = new ListNode(5); var obj = new ReverseLinkedList(); var swapList = obj.SwapPairs(list1); var list2 = new ListNode(0); list2.next = new ListNode(1); //list2.next.next = new ListNode(2); //list2.next.next.next = new ListNode(8); var list3 = new ListNode(0); var node3 = new ListNode(1); var node4 = new ListNode(2); list3.next = node3; node3.next = node4; //node4.next = list3; var rotate = RotateRight(list3, 4); var cyclic = Insert(list3, 0); var sortedList = MergeTwoLists(list1, list2); var oddEven = OddEvenList(list1); var node = RemoveElements(list1, 5); var ans = ReverseBetween(list1, 1, 5); Console.ReadLine(); }
public PalindromicLinkedList(ReverseLinkedList reverse) { this.reverse = reverse; }