RSPEC_3_median_exercise

median

Hello,

Why is 3 the expected return value for spec line 149? The odd array has a middle value of 6.

Why is 4.5 the expected return value for spec line 153? The even array has 4.0 as the average of middle two values

Median is the number that separates the higher half of the set from the lower half. High and lower, not right and left. It’s not about what’s in the middle of the array. You have to take the size of the numbers into account. What’s the middle number in size?

Thank you Jeremiah. I understand now.

Are you part of the cohort starting August 2018?

Yep! I take it you are as well? Look forward to seeing you there.