hi everyone!
i was wondering if anyone had any ideas on how to go about coding a method that would determine the median of a list of numbers
just to clarify- a median is the 'middle value' when all of the numbers are placed in increasing order;
for example- the median of
3 6 12 40 41 57 58 90
is 40.5
i was thinking about using a method that sorts the list in increasing order, then determining if there is an even or odd number of items, (if the number is even, there will be 2 middle values that have to be averaged) then 'cutting off' the first and last numbers until we reach the median value
i was wondering if anyone had any suggestions that may help with this endeavor, or even any guidance that may help me program the method!
im just not certain that this may be the easiest way, and wanted to get some feedback on what other people think..
thanks to everyone!
i was wondering if anyone had any ideas on how to go about coding a method that would determine the median of a list of numbers
just to clarify- a median is the 'middle value' when all of the numbers are placed in increasing order;
for example- the median of
3 6 12 40 41 57 58 90
is 40.5
i was thinking about using a method that sorts the list in increasing order, then determining if there is an even or odd number of items, (if the number is even, there will be 2 middle values that have to be averaged) then 'cutting off' the first and last numbers until we reach the median value
i was wondering if anyone had any suggestions that may help with this endeavor, or even any guidance that may help me program the method!
im just not certain that this may be the easiest way, and wanted to get some feedback on what other people think..
thanks to everyone!
Comment