title: Selection Sort but just one switch each iteration
body: <p>I have written a Selection Sort Algorithm which consists of two for loops. As of now, the inner loop may swap numbers several times before incrementing the outer loop. However, my goal now is to have the inner loop swap numbers exactly once and then go back to the outer for loop and repeat this until the array is sorted. I already tried it with a break statement, but then it doesn't sort the whole thing correctly.</p>
  <pre><code>    private static void selectionSort(int[] array) {        //Array wird sortiert
          
          for(int i = 0; i &lt; array.length - 1; i++) {
              
              for(int a = i + 1; a &lt; array.length; a++) {
                  
                  if(array[i] &gt; array[a]) {
                      
                      int temporaer = array[i];
                      array[i] = array[a];
                      array[a] = temporaer;
                      break;
                      
                  }
                  
              }
                      
          }
          
      }
  </code></pre>
  <p>Can you guys help me?</p>