Page 1 of 1

(Can you please help me with the following question and explain the steps below. God bless and thank you!)

Posted: Fri May 20, 2022 4:32 pm
by answerhappygod
(Can you please help me with the following question and explain
the steps below. God bless and thank you!)
Can You Please Help Me With The Following Question And Explain The Steps Below God Bless And Thank You 1
Can You Please Help Me With The Following Question And Explain The Steps Below God Bless And Thank You 1 (55.31 KiB) Viewed 22 times
Consider the following method find Min that looks for the minimum value of an integer array: // Search for minimum element 1 public boolean findMin() { 2 int min-a[0]; 3 int j=1; 4 while (j<nElems) { 5 if(a[j] < min) 6 min=a(i); 7 j++; 8 } 9 return min; 10 } // end findMin() What is the total amount of seconds for this method to take on an array of N elements in the worst case? (We again assume each comparison and each statement ending with semicolon take 1 second.) HINT: worst case is when the array is descending. In the choices below, N^2 means N2. 8*N-5 04N-1 2 N+1 0 N^2+1