📢 Too many exams? Don’t know which one suits you best? Book Your Free Expert 👉 call Now!

  • google app store apple app store
  • ✖

      Question

      An algorithm has a time complexity of O(N² ). If the

      input size N doubles, how does the execution time approximately change?
      A It doubles. Correct Answer Incorrect Answer
      B It quadruples. Correct Answer Incorrect Answer
      C It remains the same. Correct Answer Incorrect Answer
      D It increases by a factor of N. Correct Answer Incorrect Answer
      E It halves. Correct Answer Incorrect Answer

      Solution

      If the complexity is O(N² ), and N becomes 2N, the new time will be proportional to (2N)²  = 4N² . So, the execution time approximately quadruples.

      Practice Next
      ask-question