You are viewing a single comment's thread. Return to all comments →
public static int findMedian(List<int> arr) { var middleElementIndex = Math.Ceiling(arr.Count / 2.0) - 1; arr.Sort(); return arr[(int)middleElementIndex]; }
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Median
You are viewing a single comment's thread. Return to all comments →