Question: I need help with this question 28 How many passes are made through the outer for loop and after the first pass through the inner
I need help with this question 28 How many passes are made through the outer for loop and after the first pass through the inner for loop, what is the value of index ? var names = new Array("Marie", "Jose", "Zack", "Patty", "Ivan", "Tasha"); var N = 5; for (var k = 0; k <= N; k++) { var min = names[k]; var index = k; for (var j = (k + 1); j < N; j++) { if (names[j] < min) { min = names[j]; index = j; } } if (k != index) { var temp = names[k]; names[k] = names[index]; names[index] = temp; } }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
