If the list lengths are m and n, why does the merge take O(m+n) operations?
-
02-11-2019 - |
Question
If I have two sorted lists.
list A => 1 -> 2 -> 4 -> 11 -> 31
list B => 2 -> 31 -> 54
Now what should be the order of (sorted) merge and why?
According to the rule, If the list lengths are m and n, the merge takes $O(m+n)$ operations, the order should be $O(5 + 3)$. Am I right?
I would appreciate if someone help me out in understanding it.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange