Compute the running time T(N) for the following codes for any n > 0: Show all (a) int sum(int n) { int sum=0: for (int i = n: i < 0: i++) { for(int j = 0: j < n: j++) { sum=sum + 1: } } return sum: } (b) int sum (int n) { int sum = 0: for (int i = 0: i < n: i++) { for(int j = i: j < n: j++) { sum=sum + 1: } } return sum: }

    • 4 years ago
    Answer Attached
    NOT RATED

    Purchase the answer to view it

    blurred-text
    • attachment
      456.jpeg
    • attachment
      567.jpeg