M
M
mihailos2020-12-18 19:48:11
Algorithms
mihailos, 2020-12-18 19:48:11

What is the time complexity of this algorithm?

Probably a dumb question, but here is the code:

#include <iostream>

using namespace std;

int main(){
  int a, b;
  cin >> a >> b;
  cout << a + b;
}

I understand the time complexity of this algorithm is O(a + b)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2020-12-18
@mihailos

O(1)
If the notion of complexity applies to this code at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question