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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 18 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));
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply