What is the asymptotic complexity of the following function


What is the asymptotic complexity of the following function and how did you arrive to this answer. int selectkth(int a[ ], int k, int n) { int i, j, mini, tmp; for (i=0; i < k; i++) { mini = i; for (j = i+1; j < n; j++) { if (a[ j ] < a[ mini ]) mini = k; tmp = a[ i ]; a[ i ] = a[ mini ]; a[ mini ] = tmp; } } return a[k-1]; }

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: What is the asymptotic complexity of the following function
Reference No:- TGS0645921

Expected delivery within 24 Hours