What is the fastest way to computer median of 3 integers?
Posted on 2011-03-15
I think I've been straining my head too much lately because this should be easy, none the less...
int getMedian(int a, int b, int c)
How do I determine the median integer? I don't want to do this by putting them in an array and sorting them, its only 3 integers. I think the most efficient way can probably be performed in 2-3 if statements, but I can't seem to figure them out. Please help, its easy points and you'll be helping my overstressed mind, ha.