Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 25th, 2012  |  syntax: None  |  size: 0.43 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Basic algorithm proof
  2. Sorted:
  3. [lowest, low, low, x] distance1 = x-lowest
  4. [y, high, high, highest] distance2 = highest-y
  5.  
  6. Swapped:
  7. [lowest, low, low, y] distance3 = y-lowest
  8. [x, high, high, highest] distance4 = highest-x
  9.        
  10. [lowest, low, low, y]
  11. [high, high, highest, x]
  12.        
  13. [lowest, low, low, x]
  14. [lowM, lowM, highM, highM]
  15. [highM, y, high, highest]
  16.        
  17. [lowest, low, lowM, lowM]
  18. [highM, highM, highM, y]
  19. [x, highM, high, highest];