Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

codemaster_21's blog

By codemaster_21, history, 11 months ago, In English

- How to find Time complexity.

  1. It is simple when you using only one loop so your time complexity is O(n).
  2. When your loop ends in middle so time complexity is O(nlogn).
  3. When you using only condition and pointer time complexity is O(1).
  • Vote: I like it
  • -21
  • Vote: I do not like it

»
11 months ago, # |
  Vote: I like it +5 Vote: I do not like it

Thanks a ton!! When will we get O(n^2)?? /s

  • »
    »
    11 months ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    When you use loop A and you use another loop B in loop A so your time complexity will be 0(n^2).