function median(arr){
		var half = Math.floor(arr.length/2);

		if(arr.length % 2)
			return arr[half];
		else
			return (arr[half-1] + arr[half])/2;
	}
// Returns the median of an already sorted array
Returns the median of an already sorted array
Returns the median of an already sorted array
function median(arr){
		var half = Math.floor(arr.length/2);
		if(arr.length % 2)
			return arr[half];
		else
			return (arr[half-1] + arr[half])/2;
	}
function median ( arr ) { var half = Math . floor ( arr . length / 2 ) ; if ( arr . length % 2 ) return arr [ half ] ; else return ( arr [ half - 1 ] + arr [ half ] ) / 2 ; }
Returns the median of an already sorted array
Returns the median of an already sorted array