Sort three variables: Difference between revisions

added an algorithm (for numeric values only) to the task's preamble..
(added an algorithm (for numeric values only) to the task's preamble..)
Line 17:
z = 'lions, tigers, and'
 
<!-- Care was taken to use a leading lowercase letter so that EBCDIC and ASCII machines sort the literals in the same order. {Gerard Schildberger} !-->
For numeric value sorting, use:
I.E.: &nbsp; (for the three variables &nbsp; '''x''', &nbsp; '''y''', &nbsp; and &nbsp; '''z'''), &nbsp; where:
Line 46:
Θ extract the three elements from the array and place them in the
variables '''x''', '''y''', and '''z''' &nbsp; in order of extraction
 
 
 
Another algorithm &nbsp; (only for numeric values):
x= 77444
y= -12
z= 0
low= x
mid= y
high= z
x= min(low, mid, high) /*determine the lowest value of X,Y,Z. */
z= max(low, mid, high) /* " " highest " " " " " */
y= low + mid + high - x - z /* " " middle " " " " " */
 
 
Show the results of the sort here on this page using at least the values of those shown above.