What is the Big-O running time for this code? Explainyour answer. i = num; while
ID: 3616442 • Letter: W
Question
What is the Big-O running time for this code? Explainyour answer.i = num; while (i > 0) { System.out.println(i); i = i / 2; }
Give the Big-O notation for the following expressions: 3n * log(n) + 11 [n(n+1)/2 + n] / 2
What is the Big-O running time for this code? Explainyour answer.
i = num; while (i > 0) { System.out.println(i); i = i / 2; }
Give the Big-O notation for the following expressions: 3n * log(n) + 11 [n(n+1)/2 + n] / 2
Give the Big-O notation for the following expressions: 3n * log(n) + 11 [n(n+1)/2 + n] / 2
3n * log(n) + 11 [n(n+1)/2 + n] / 2
Explanation / Answer
Dear User, i = num; while (i > 0) { System.out.println(i); i = i / 2; } while (i > 0) { System.out.println(i); i = i / 2; } The while loop runs more times.Therefore the complexity of the given code snippet is O(logn) ITS HELPFUL TO YOU...
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.