Merge Two Sorted Lists | LeetCode 21 | Amazon Coding Interview Tutorial

preview_player
Показать описание
Merge Two Sorted Lists solution: LeetCode 21

AFFILIATE LINKS
If you're interested in learning algorithms, these are great resources.

💲 All coupons and discounts 💲

Merge Two Sorted Lists | LeetCode 21 | Amazon Coding Interview
#mergetwosortedlists #leetcode #algorithms #terriblewhiteboard #codinginterview

Click the time stamp to jump to different parts of the video.
00:00 Title
00:06 Problem readout
01:02 Whiteboard solution
04:29 Coding solution
11:42 Result and outro
Рекомендации по теме
Комментарии
Автор

If there are any videos you'd like me to make or if you have any ideas on how to optimize this solution, let me know!

TerribleWhiteboard
Автор

informative unlike other who will just wetite the code and call it a tutorial thanks! eventhough i use C++

cocoarecords
Автор

thanks bro, good job with the explanation. Also, I was using mainly python to do this, and its nice to see someone using JavaScript!

umaiir_shabbir
Автор

I've looking for this explanation for a whole week !! thank you

nadilmohammad
Автор

Best explanation of this problem in easy to understand terms. Thank you so much

stephanieonyekaba
Автор

Thanks for this man. The whiteboard drawing really really helps.

joeekadi
Автор

Amazing explanation to an intimidating problem. Thank you.

IRLVaporwave
Автор

Your explanations are far better and understandable than other so called "Leetcode explanation videos". Don't understand why there are not enough views in your channel 😡.

VIKASKUMARHBK
Автор

good job with a detailed explanation, cheers

TekkenRoom
Автор

Thank you, Sir. Hope can see your update:)

sophiali-CBR-AU
Автор

Your time and space complexity was better than nick white's. And so was your explanation. Thanks.

parthsalat
Автор

how is head.next not null? when was head.next ever assigned to?

didoma
Автор

Thanks for the explanation,
I followed along however, can you explain the code at the bottom of the page and why you need to make a class called ListNode?
Also, the return head.next at the end of the page isn't in a loop and not including in the If statement, how does it know to keep going till it reaches null?

thedonsky
Автор

sorry if this sounds dumb, but does the order of the original two linked lists change as well after they are sorted?

matteobarberis
Автор

Im a bit confused, I was trying to do this problem on leetcode, and the input l1= [1, 2, 4]
when I console.log it just prints out an array.

Why does it behave the way it does.

I was thinking I had to do something like dummy.next = l1[pointerIndex]

tom-czjx
Автор

how does head.next rerurn the entire list?

Github_tech_with_ty
Автор

How does head keep the full sorted list if you reassign dummy = dummy.next in the line 25?

luispuentes
Автор

For line 17, why not just do

while (l1 && l2)? Shouldn't that implicitly be "while not null"?

vi_obsiver
Автор

I simply don't understand why you are comparing two lists together? if l1 = [1, 2, 3], how could you compare with l2 [2, 3, 4]? let alone if you put l1.val in it? aren't l1.val === 1, or 2, or 3? can someone explain this linked list to me? thanks

lordmoma
join shbcf.ru