Page 1 of 1

Please read the code very carefully, and decide what is the time complexity (in Big-o notation) of the following method?

Posted: Fri Apr 29, 2022 6:42 am
by answerhappygod
Please Read The Code Very Carefully And Decide What Is The Time Complexity In Big O Notation Of The Following Method 1
Please Read The Code Very Carefully And Decide What Is The Time Complexity In Big O Notation Of The Following Method 1 (38.56 KiB) Viewed 20 times
Please read the code very carefully, and decide what is the time complexity (in Big-o notation) of the following method? Justify your answer. = == == 1)) { void someMethod (int n) { for (int i 0; i < n; i++) { if (((n % 2) 0) || ((n % 2) break; } for (int j 0; j < n; j++){ System.out.println("i * j } } } = + (i*j));