Merge Sort Algorithm in C#

Here is the code:


        public int[] MergeSort(int[] arr)
        {

Merge two sorted arrays to one array in C#

Here is the code:
        public static int[] Merge(int[] nums1,  int[] nums2)

Binary search algorithm with recursion in C#

Here is the code:

    public int Search(int[] nums, int target) { 

Binary search algorithm without recursion in C#

Here is the Code:

    public int Search(int[] nums, int target) { 
        int s=0;

Rotate Array to K places in C#

Given an array, rotate the array to the right by k steps, where k is non-negative.
Example 1:
Input: [1,2,3,4,5,6,7] and k = 3

Popular Posts