What will be time complexity of pushing array in vector and sorting vector?

Please explain. I am talking about of median of sorted arrays question.

median of 2 sorted arrays can be computed in O(n+m) where n is length of one array and m is length of another

what will be time complexity of pushing array in vector?

u mean pushing a vector into vector<vector> ?? its simply O(1)

1 Like

ohkaay, can we push an array directly into vector or we have to iterate over the element?

we an simply push…
consider vector<vector> v
and vector temp
we can simply write v.push_back(temp)

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.