We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
1 2 3 4 5 6 7 (the order from small to big 1..2..3....) we got 7 numbers
The median = 6 which is Number 4 in ascending order
How we get number 4? it is (7+1)/2 ....so if the number was odd
the median will be number=(n+1)/2 which n is the count in asc order...if you counted the dataset it will be 499...(499+1)/2=250
so the data which number is 250 is the median
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 5
You are viewing a single comment's thread. Return to all comments →
To calc the median..
EX: (2 4 5) 6 (7 8 10)