You are viewing a single comment's thread. Return to all comments →
The complexity of above second one is also O(n), as in first loop it takes input and in second it gives output. Both loops are isolated.
Sequence Equation
You are viewing a single comment's thread. Return to all comments →
The complexity of above second one is also O(n), as in first loop it takes input and in second it gives output. Both loops are isolated.