Coding Interview Tutorial 26: Merge Sorted Arrays [LeetCode]

preview_player
Показать описание
This video will teach you how to merge two sorted arrays!

This is an important programming interview question, and we use the LeetCode platform to solve this problem.

Рекомендации по теме
Комментарии
Автор

Most easiest, simplest and one of the fastest solution, Thank you sir!

rahulsbhatt
Автор

Bravo, sir! That was perfectly explained.

nicholashoell
Автор

Hey! why do we have second while loop only for "n" ?

devtorch
Автор

Man how to solve the same question with this kind of parameter ?
public void merge(List< Integer>nums1, int m, List<Integer> nums2, int n)

trustGod
Автор

thank you, your solution is faster than mine, but i don't understand why you use the second while loop, i don't know the case that some element in nums2 wont pass to nums1. can you give me a example?

chenchangyuan
Автор

Does not work against the following input:
int[] nums1 = {4, 0, 0, 0, 0, 0};
int[] nums2 = {2, 5, 6};
m=1
n=3
comes: [4, 0, 2, 4, 5, 6]

shreyash
Автор

the lightmode is blinding, but good video nonetheless

tylersehon
welcome to shbcf.ru