First find the bigOh running time of inside in terms of inpu

First, find the big-Oh running time of inside, in terms of input sizes n_a and n_b. private static double[] inside(double[] a, double[] b) {double[] c = new double[a.length]; int i = 0, j = 0; for (int k = 0; k

Solution

The time taken in terms of big O is O(n) as there is only 1 for loop in the function. hence the time complexity is O(n).

Outside the function also The time taken in terms of big O is O(n) as there are 2 for loop but are seprate hence it will take linear time only.

 First, find the big-Oh running time of inside, in terms of input sizes n_a and n_b. private static double[] inside(double[] a, double[] b) {double[] c = new do

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site