title: Selection Sort - Index of Min/Max
body: <p>I was looking through the selection sort algorithm on <a href="http://www.cprogramming.com/tutorial/computersciencetheory/sorting2.html" rel="nofollow noreferrer">cprogramming.com</a>
  and I think I found an error in the implementation.</p>
  
  <p>If you work through the algorithm, there's a variable called "index_of_min" which I believe should be "index_of_max" (since when I tested it, it was sorting largest to smallest).</p>
  
  <p>Thinking that it was a typo or a minor mistake, I checked out some other websites like <a href="http://en.wikipedia.org/wiki/Selection_sort" rel="nofollow noreferrer">wikipedia</a> and some lesser known websites like <a href="http://www.geekpedia.com/tutorial288_Selection-Sort-Algorithm-in-Java.html" rel="nofollow noreferrer">geekpedia</a>.  It seems like they are call it index of min.</p>
  
  <p>When I ran it through the debugger, it really seemed to me that it's the max value's index.  Am I making a mistake somewhere?</p>
  
  <p>Edit: As Svante pointed out, only the cprogramming implentation is wrong.  Wikipedia and Geekpidia are fine.</p>