I wrote pseudocode for
Selection Sort, but I'm not sure what is the running time of my algorithm, can you help me with that?
My Pseudocode: Selection Sort(int a, int n)
Input: array of length $n$
Output: sorted array
for r=1 to n min=a[r] for i=r to n if (a[i]<min) min=a[i] k=i a[k]=a[r] a[r]=min
for takes $\Theta (n)$ but I'm not sure about the internal
for because it depends on $r$.