What would be the time complexity of two reversed arrays merge into one sorted array?
Is it O(n) or O(log n)?
If both of the given arrays are in reversed sorted order it would be O(m + n)(m - length of 1. array, n - length of 2. array)
because you need to iterate linearly through both arrays.
But if arrays are not sorted you have 2 options:
O(nlogn + mlogm)
.O(nlogn + mlogm)
.