DEV Community

Discussion on: 🎯Merge two sorted arrays without using any extra space🎯

Collapse
 
trueneu profile image
Pavel Gurkov

Um, this is not O(n) but O(nlogn), unless you can sort in linear time.

And there are a number of others with the same upper limit.

It seems to me that this cannot be done linearly, but I wanted to ask what's your thoughts on this.

Thread Thread
 
kaiwalyakoparkar profile image
Kaiwalya Koparkar

I got your point. I found this as the only optimal way (As far as I found)