private static void FirstBadVersion() { int n = 4; SortNSearch sortNSearch = new SortNSearch(); sortNSearch.FirstBadVersion(n); }
private static void MergeSortedArrays() { int[] nums1 = new int[] { 1, 2, 3, 0, 0, 0 }; int[] nums2 = new int[] { 2, 5, 6 }; SortNSearch sortNSearch = new SortNSearch(); sortNSearch.MergeSortedArrays(nums1, 3, nums2, 3); }
private static void SearchRotated() { int[] arr = { 4, 5, 6, 7, 8, 9, 1, 2, 3 }; int target = 6; SortNSearch sortNSearch = new SortNSearch(); sortNSearch.SearchRotated(arr, target); }
private static void SearchRoatedDuplicate() { int[] arr = { 1, 3, 1, 1, 1 }; int target = 3; SortNSearch sortNSearch = new SortNSearch(); Console.WriteLine(sortNSearch.SearchRoatedDuplicate(arr, target)); }
private static void MergeIntervals() { var intervals = new List <Interval>() { new Interval(1, 4), new Interval(0, 4) }; SortNSearch sortNSearch = new SortNSearch(); sortNSearch.MergeIntervals(intervals); }
private static void CanAttendMeetings() { var intervals = new List <Interval>() { new Interval(5, 10), new Interval(0, 30), new Interval(15, 20) }; SortNSearch sortNSearch = new SortNSearch(); sortNSearch.CanAttendMeetings(intervals.ToArray()); }
private static void MergeTwoLists() { ListNode l1 = new ListNode(1); l1.next = new ListNode(2); l1.next.next = new ListNode(4); ListNode l2 = new ListNode(1); l2.next = new ListNode(3); l2.next.next = new ListNode(4); SortNSearch sortNSearch = new SortNSearch(); sortNSearch.MergeTwoLists(l1, l2); }