public void TestCheckPalindrome() { LinkedList L1 = new LinkedList(); L1.AddLast(1); var head = LListProblems.CheckPalindrom(L1.Head); }
public void TestRemoveMatchingElements() { LinkedList L1 = new LinkedList(); L1.AddLast(2); LListProblems.removeAllMatchingElements(L1.Head, 2); }
public void TestRotateBykthNumber() { LinkedList L1 = new LinkedList(); L1.AddLast(1); //L1.AddLast(2); //L1.AddLast(3); //L1.AddLast(4); //L1.AddLast(5); var head = LListProblems.RotateLinkedList(L1.Head, 99); }
public void TestRemoveNthNode() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(2); L1.AddLast(3); //L1.AddLast(4); //L1.AddLast(5); var head = LListProblems.RemoveNthFromEnd(L1.Head, 3); }
public void TestSwapPairs() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(2); L1.AddLast(3); L1.AddLast(4); var head = LListProblems.SwapPairs(L1.Head); }
public void TestReverseLinkedList() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(2); L1.AddLast(3); L1.AddLast(4); L1.AddLast(5); LListProblems.ReverseLinkedList(L1.Head); }
public void TestGetMiddleNode() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(2); L1.AddLast(3); L1.AddLast(4); L1.AddLast(5); ListNode middleNode = LListProblems.GetMiddleNode(L1.Head); }
public void TestNextGreaterNode() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(4); L1.AddLast(3); L1.AddLast(5); L1.AddLast(2); var head = LListProblems.NextGreaterNode(L1.Head); }
public void TestRemoveDuplicatesFromSorted() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(2); L1.AddLast(2); L1.AddLast(3); L1.AddLast(3); var head = LListProblems.RemoveDuplicatesFromSortedLinkedList(L1.Head); }
public void FindCountofConnectedComponents() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(4); L1.AddLast(3); L1.AddLast(5); L1.AddLast(2); int[] array = { 1, 4, 3, 2 }; var counts = LListProblems.ConnectedComponentsCounts(L1.Head, array); }
public void TestMethod1() { LinkedList L1 = new LinkedList(); L1.AddLast(2); L1.AddLast(3); LinkedList L2 = new LinkedList(); L2.AddLast(1); //L2.AddLast(9); LListProblems.AddTwoNumbers(L1.Head, L2.Head); }
public void TestGetInterSectionNode() { var node6 = new ListNode(6); var node5 = new ListNode(5); node5.next = node6; var node4 = new ListNode(4); node4.next = node5; var nodeA3 = new ListNode(3); nodeA3.next = node4; var nodeA2 = new ListNode(2); nodeA2.next = nodeA3; var nodeA1 = new ListNode(1); nodeA1.next = nodeA2; var nodeB2 = new ListNode(22); nodeB2.next = node4; var nodeB1 = new ListNode(4); nodeB1.next = node5; var head = LListProblems.FindNodeIntersection(nodeA1, node4); }
public void RemoveDuolicates() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(1); L1.AddLast(1); L1.AddLast(2); L1.AddLast(2); L1.AddLast(3); //L1.AddLast(3); //L1.AddLast(4); var head = LListProblems.RemoveDuplicateNode(L1.Head); }
public void TestMergeTwoSortedList() { LinkedList L1 = new LinkedList(); L1.AddLast(1); L1.AddLast(2); L1.AddLast(4); LinkedList L2 = new LinkedList(); L2.AddLast(1); L2.AddLast(3); L2.AddLast(4); var head = LListProblems.MergeTwoSortedList(L1.Head, L2.Head); }