What is the time complexity of these algorithms, in terms of n? [Sum += y is a s
ID: 3760050 • Letter: W
Question
What is the time complexity of these algorithms, in terms of n? [Sum += y is a short form notation for Sum = Sum + y.] (Only write answers, NO explanations]
for (int i = 1 to n) {
j = 1
while (j < n) {
k = j
while (k < n) {
Sum += a[i]*b[j]*c[k] k += log log n
}
j += log (j+5)
int j = 2
while (j < n) {
int k = j
while (k < n) {
Sum += a[k]*b[k]
k += r11/3 log n
}
j = j*sqrt(5)
}
int j = 2
while (j < n) {
int k = 3
while (k < n) {
Sum += a[j]b[k]
k+= sq rt (n)
}
j++
}
subjact
design and analysis algorithm
Explanation / Answer
1) O(log n)
2) O(n^5 log n)
3) O(n^2)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.