Please read the code very carefully, and decide what is the time complexity (in Big-o notation) of the following method?
-
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?
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!