0

I'm currently doing a class assignment and would like to ask a quick question about time complexity whenever we have 2 comparison operators joined by the word "and". Would it be O(1) or O(2) in Non-Big-O notation? Because I want to trace every operation in my own algorithm. For instance, What would be the time complexity of line A in Non-Big-O notation would it be O(2)?

list1 = []
counter = 0
If len(list1) > 0 and counter!= max:  #line A
  list1.append(counter)
  counter += 1

return list1

0 Answers0