Find asymptotic runtimes of the following functions. Give runtime in terms of Big-O function of n int functionA (int n)
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Find asymptotic runtimes of the following functions. Give runtime in terms of Big-O function of n int functionA (int n)
Find asymptotic runtimes of the following functions. Give runtime in terms of Big-O function of n int functionA (int n) { (6) Asymptotic runtime of functionA int i = n, j, sumA = 0; for (i=10; i < n; i=i+10) { j = i; while (j < n) { sumA = sumA + (i * j); j++; } } return sumA; (7) Asymptotic runtime of functions int functions (int n) { int i, j, sumB = 0; for (i=n; i > 1; i=i/2) { if (i % 10 == 0) continue; for (j=1; j < n; j-j*2) sumB = sumB + i + j; } return sumB;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!