Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 1; i < a; i++){
- for(int j = 1; j < b; j++){
- Function() <-- O(1)
- }
- }
- In this case, the outer loop will be executed 'a'times(O(a)), and
- the inner loop will be executed 'b/a' times(O(b/a)).
- Then the total time complexity will be O(a * b/a ) = O(b)?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement