Find the Median

  • + 0 comments

    C#:

    public static int findMedian(List<int> arr)
        {
           arr.Sort();
           int middleIndex = arr.Count/2;
           return  arr[middleIndex];
        }