Consider the following dataset representing the ages (in years) of a group of 10 participants in a clinical trial:
28, 35, 42, 29, 30, 32, 37, 40, 41, 34.
Using this dataset, calculate the mean and median ages of the participants. After performing the calculations, compare the outcomes of the mean and median.