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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 21 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply