1/25
Loading...
🪨Find the Median!
There are 5 meteorite samples. We need to find the value exactly in the middle when sorted by weight.
Loading...
There are 5 meteorite samples. We need to find the value exactly in the middle when sorted by weight.
During space exploration, N meteorite samples were collected. Given the weight of each meteorite, write a program to find the median weight when listed in order.
5 45 12 89 33 57
45
Sorting the weights gives [12, 33, 45, 57, 89]. The middle value is 45.