Question 1 please! The language is in java
Thank you!
Worst Case Equation Find the worst-case runtime f(n) for the following algorithms. Specify the number of operations executed for an input size n, for the worst case run time as a function of n. Surround the statement(s) with a box and draw a line to the right side specifying the number of operations. If statement(s) are a part of an iteration of n, specify the total number of iterations as a function of n. 1. Algorithm-01 Find the worst case run time function f(n) of the following algorithm. int sum = 0; for (int i = 1; i <= n; i++) for (int j = 1; j <= 10; j++) sum += 2; for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) sum++;
Worst Case Equation Find the worst-case runtime f(n) for the following algorithms. Specify the number of operations exec
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am