Examples/AirlineFaresNew/src/main/java/com/cs6240/airline/Calculations.java
/*
	 * This method calculates median for a airline for a month 
	 * Returns output in a map : (airline month , median)
	 */
This method calculates median for a airline for a month
Returns output in a map : (airline month , median)
This method calculates median for a airline for a month Returns output in a map : ( airline month median )
public static Double calculateMedian(List<Double> priceList){
		Double medianPrice = 0.0;
		Collections.sort(priceList);
		int middle = priceList.size()/2;
		if (priceList.size() % 2 == 1) {
			medianPrice = priceList.get(middle);
		} else {
			medianPrice = (priceList.get(middle - 1) + priceList.get(middle))/2;
		}
		return medianPrice;
	}
public static Double calculateMedian ( List < Double > priceList ) { Double medianPrice = 0.0 ; Collections . sort ( priceList ) ; int middle = priceList . size ( ) / 2 ; if ( priceList . size ( ) % 2 == 1 ) { medianPrice = priceList . get ( middle ) ; } else { medianPrice = ( priceList . get ( middle - 1 ) + priceList . get ( middle ) ) / 2 ; } return medianPrice ; }
This method calculates median for a airline for a month
 Returns output in a map : (airline month , median)
This method calculates median for a airline for a month Returns output in a map : ( airline month median )