algorithm - sorting int array with only 3 elements -


i have array:

int [] myarray =  {17, 6, 8}; 

what optimal way sort array, in pseudocode?

thanks!

i think should quite fast (ascending order):

if (el1 > el2) swap(el1,el2) if (el2 > el3) swap(el2,el3) if (el1 > el2) swap(el1,el2) 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -