How is the median determined for ungrouped data?
A) By calculating the average of all values
B) By arranging the data in ascending order and selecting the middle value
C) By identifying the most frequently occurring value
D) By finding the midpoint of the cumulative frequency distribution