title: Confusion with the following selection sort code
body: <pre><code>int i, j, t;
  
  for (i = 0; i &lt; n - 1 ; i++) {
      for (j = i + 1; j &lt; n; j++) {
          if (a[i] &gt; a[j]) {
              t = a[i]; 
              a[i] = a[j]; 
              a[j] = t;
          }
      }
  }  
  </code></pre>
  
  <p>My question is whether the above code is correct selection sort code or not? I got this code from various books. If it is incorrect then please explain why. </p>