Learn how to merge two sorted array in Python!

preview_player
Показать описание
Extensive program for working professionals with interview prep, placement support and mentorship:-

Smash that 'Like' button and hit 'Subscribe' to stay ahead in the coding game. Let's go on this coding adventure together! 💫

Playlists curated for our students: 👇
Рекомендации по теме
Комментарии
Автор

super explanation bro and make more videos on coding problems

vtfkwcw
Автор

Watch from 4:47 then watch from beginning it makes it easy to understand. Thank you well explained!

yashwanthaas
Автор

i did'nt understand at 6:15 . How i < len(1) ???

nanugaming
Автор

Excellent explanation.
But what about the time complexity of the code?
Isn't it 0(3n)

vishalbhadoriya
Автор

Instead of the second while loop, we could have done:

If(i<len1):
arr.append(arr1[i:])

Any thoughts?

beatalert
Автор

Beautiful explanation ..Thanks very much

sunilsrinivaas
Автор

Best explanations bro....thanks a lot...

mehedihossain
Автор

arr1 = [1, 2, 3, 5, 8]
arr2 = [2, 4, 6, 9]


def mergearray(arr1, arr2):
arr = sorted(arr1+arr2)
return arr
print(mergearray(arr1, arr2))

namratasukanya
Автор

Nice explained one by one ... it's really helpful ... i love to watch your more videos ... thanks

rosgulla
Автор

For the last before loop while I<=n, if inplace of 9, if it is 11(or >10) then it will append into arr, then it won't be a sorted array right ?
And I'm getting indexerror while trying this

-W-Sridevibommidi
Автор

Logic is somewhat similar to merge sort

consistentthoughts