title: How To calculate time complexity of selection sort
body: <p>Time complexity of Selection Sort(Worst case) using Pseudocode:</p>
  
  <pre><code>'Selection-Sort(A)
  
  1 For j = 1 to (A.length - 1)
  
  2   i = j
  
  3   small = i
  
  4   While i &lt; A.length
  
  5     if A[i] &lt; A[small]
  
  6       small = i
  
  7     i = i + 1
  
  8   swap A[small], A[j]
  </code></pre>
  
  <p>First step will occur n-1 times (n is length of array). So the second and third. I am stuck with 4th step whether it will occur n! times or something else.</p>