Question: Questions 7-12 are 10 points each. Assume numItems has the role of N, which may vary from one run to the next. In explaining your

 Questions 7-12 are 10 points each. Assume numItems has the role

of N, which may vary from one run to the next. In

Questions 7-12 are 10 points each. Assume numItems has the role of N, which may vary from one run to the next. In explaining your answer, describe how the analysis rules apply to the code. 7. What is the Big-o running time for this code? Explain your answer. for (int i-e; i 0) 1-17 2; // Integer division will eventually reach zero Type here to search OLE *IO IL L Knumitems; i++) System.out.println(i); else System.out.println("too many"); What is the Big-0 running time for this code? Explain your answer. int i = numItems; while (i > 0) i = i / 2; 7/ integer division will eventually reach zero 12. What is the Big-o running time for this code? Explain your answer. public static int div(int numItems) if (numItems == 0) return 0; else return numItems%2 + div(numItems/2): Submit: A file named assignment2.zip

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!