What is the overall running time of the following
for (i=o; i
Answers
Answered by
0
Answer:
plzz support me mates
Explanation:
Output:
3. O(N + M) time, O(1) space
Explanation: The first loop is O(N) and the second loop is O(M). Since we don’t know which is bigger, we say this is O(N + M). This can also be written as O(max(N, M)).
Since there is no additional space being utilized, the space complexity is constant /Output:
Similar questions