For median, make sure you put the numbers in increasing order! This is the only way you will find the median.
For example, if I had set a={4,6,5} and I didn't put them in order, I would say 6 is the median, however this is not true! You would have to put them in order {4,5,6} and you would realize the median is actually 5.
For mean, assuming arithmetic mean, where you take the average, this does not matter as the equation for arithmetic mean is ((a+b+c.../number of terms))