Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. for (int i = 1; i < a; i++){
  2. for(int j = 1; j < b; j++){
  3. Function() <-- O(1)
  4. }
  5. }
  6.  
  7. In this case, the outer loop will be executed 'a'times(O(a)), and
  8. the inner loop will be executed 'b/a' times(O(b/a)).
  9. Then the total time complexity will be O(a * b/a ) = O(b)?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement