L23. Merge two sorted Linked Lists

  Рет қаралды 67,764

take U forward

take U forward

Күн бұрын

Пікірлер: 70
@shubhambhatt2704
@shubhambhatt2704 10 ай бұрын
Bro woke up and dropped the whole playlist
@Hariprasath-bl6dt
@Hariprasath-bl6dt 4 ай бұрын
Turu
@ashwaniagrawal27
@ashwaniagrawal27 8 ай бұрын
Definittely this is one of the best playlist on linked list in youtube.
@SaiSumanthKovuru
@SaiSumanthKovuru 10 ай бұрын
best series i have ever seen especially the dry run thank u so much for an exceptional series
@393ShivamRajput
@393ShivamRajput 9 ай бұрын
Great video, --> This video is not updated in the SDE sheet and in the Article as well.
@neerkhandor5007
@neerkhandor5007 10 ай бұрын
Byfar the best linked list series Thank you very much Raj Bhaiya
@amarpalji
@amarpalji 8 ай бұрын
Thanks for clean code. sudo code have minor issue , please correct it . if ( t1 -> data < t2 -> data ) You missed equal elements . it should be if ( t1 -> data data )
@anirudhv0062
@anirudhv0062 6 ай бұрын
yes. I wondered the same. I came here from leetcode. there some values in the two sorted lists which are same. but what an explanation. I know only basics of linked lists. I was able to undersand well enough
@ujjwalsingh6889
@ujjwalsingh6889 6 ай бұрын
There is no need for this Equal to condition bcz it already handled by else part But it is good to think about this condition👍👍
@anirudhv0062
@anirudhv0062 6 ай бұрын
@@ujjwalsingh6889 yes. I realized it later. when I did a dry run. Thanks for replying ujjwal
@rahulmandal4007
@rahulmandal4007 4 ай бұрын
@@anirudhv0062 You need to improve your DSA These are basics
@jnayehsirine6222
@jnayehsirine6222 7 ай бұрын
we missed youuu here ! KEEP UP THE GREAT WORK YOU'RE DOIN MAN
@robot3.077
@robot3.077 9 ай бұрын
Bhaiya ,I can definitely say, you are god of DSA❤❤
@sohamsonwane1534
@sohamsonwane1534 9 ай бұрын
meri tarf se ik papii supper good explanation
@OrderEmperor
@OrderEmperor 9 ай бұрын
🏳️‍🌈
@kirannaik4417
@kirannaik4417 5 күн бұрын
Loved it, bro!
@itsd2388
@itsd2388 10 ай бұрын
Bhaiya when can we expect stack queue playlist
@rajatraj4297
@rajatraj4297 4 ай бұрын
why this problem is not in the A2Z sheet?
@rajatshukla2605
@rajatshukla2605 12 күн бұрын
Understood!
@Bhawna-ir1gr
@Bhawna-ir1gr 10 ай бұрын
amazing explanation ✨✨
@ManojKumar-do1rh
@ManojKumar-do1rh 7 ай бұрын
Thanks ... nice explaination
@crazyfacts4434
@crazyfacts4434 9 ай бұрын
Very good explanation. 😊😊
@dayashankarlakhotia4943
@dayashankarlakhotia4943 10 ай бұрын
class Solution { public ListNode mergeTwoShortedLists(ListNode l1,ListNode l2){ ListNode ans=new ListNode(-1); ListNode temp=ans; while(l1!=null&&l2!=null){ if(l1.val
@aakashbhandari9761
@aakashbhandari9761 10 ай бұрын
Welcome Back sir❤🎉
@RAHULSINGH-cd6gl
@RAHULSINGH-cd6gl 9 ай бұрын
On which topic you will be making your next playlist??
@atulwadhwa192
@atulwadhwa192 8 ай бұрын
shouldn't time complexity be min(n1,n2) coz this is where while stops and then it's just one extra link that we've to do?
@shahidullahmuffakir668
@shahidullahmuffakir668 6 ай бұрын
if the smaller values were in the n2 then in this case we will traverse till the end of n2. so min(n1,n2) will not work.
@hashcodez757
@hashcodez757 3 ай бұрын
Epic bhaiya!!
@DeadPoolx1712
@DeadPoolx1712 Ай бұрын
UNDERSTOOD;
@sujalsingh9365
@sujalsingh9365 10 ай бұрын
Happy New Year 🎉
@YourCodeVerse
@YourCodeVerse 9 ай бұрын
Understood✅🔥🔥
@ddevarapaga5134
@ddevarapaga5134 3 ай бұрын
Best bhai Thank you
@samriddhichoubey7832
@samriddhichoubey7832 29 күн бұрын
In which lec you've explained the concept of dummy nodee?
@subee128
@subee128 10 ай бұрын
Thanks
@adebisisheriff159
@adebisisheriff159 8 ай бұрын
Thanks Striver!!1
@d.praful
@d.praful 4 ай бұрын
Nice explanation ❤
@justsomeguywithoutamustach9978
@justsomeguywithoutamustach9978 4 ай бұрын
To be exact, time complexity would be O(min(n1 + n2)).
@ArpanChakraborty-do6yz
@ArpanChakraborty-do6yz 7 ай бұрын
Awesome 😎 17:36
@m1stnoob201
@m1stnoob201 4 ай бұрын
Can't we use dummy node to make it as a copy of the lowest head value of either of the lists (which acts as the head of the new merged list) , and repeat the same process . Will the solution be different ?
@NARUTOUZUMAKI-bk4nx
@NARUTOUZUMAKI-bk4nx 9 ай бұрын
Understoood
@himanshidafouty347
@himanshidafouty347 4 ай бұрын
Understood
@VibhaJamadagni-hz6ck
@VibhaJamadagni-hz6ck 4 ай бұрын
understood
@abhishekprasad010
@abhishekprasad010 5 ай бұрын
What if I use a multiset instead of an array in brute force approach??
@nayankhuman1043
@nayankhuman1043 Ай бұрын
understood :)
@musabahmed567
@musabahmed567 7 ай бұрын
I'm confused how the space complexity is O(1)? We are creating a dummy node which extends to hold the nodes of both linked list 1 and linked list 2. Don't the space complexity be O(n1+n2) where n1 are number of nodes in linked list 1 and n2 are number of nodes in linked list 2.
@gulugulu-pw2ds
@gulugulu-pw2ds 6 ай бұрын
ACTUALLY ITS LIKE VARIABLE DECLARATION .
@aneeketvispute5063
@aneeketvispute5063 3 ай бұрын
we are not creating a new node we are just declaring it like a temp node
@karthikeyan.s2565
@karthikeyan.s2565 2 ай бұрын
​@@aneeketvispute5063bro If we change temp.next = t2 then how the next node of t1 is not lost Since we're changing the link
@No-yp1uv
@No-yp1uv 2 ай бұрын
is this a dynamic programming problem?
@cenacr007
@cenacr007 6 ай бұрын
I couldn't find this question in the a2z playlist.
@atulwadhwa192
@atulwadhwa192 8 ай бұрын
8:15 Can anyone tell in which video dummy node concrpt is explained by him😅
@codeman3828
@codeman3828 8 ай бұрын
Undertsood
@ashishpradhan6250
@ashishpradhan6250 4 ай бұрын
Nyc
@YashGaneriwal-je6rh
@YashGaneriwal-je6rh 2 ай бұрын
done and dusted
@OmkarKudalkar
@OmkarKudalkar 10 күн бұрын
letsss fuckin gooooooo did both the approaches by only just getting one hint and last handling of edge case where i is not null where i tell temp ki tera next is i and vice versa yaaay
@nashratjahan9371
@nashratjahan9371 9 ай бұрын
There's a little mistake at the end for handling remaining nodes after either one list has reached null, there should be a another while loop to handle those cases. Also there isn't a java code to the above problem kindly provide one
@gokulanvs
@gokulanvs 9 ай бұрын
No need for while loop , see the video 11:40
@md.ualiurrahmanrahat2400
@md.ualiurrahmanrahat2400 9 ай бұрын
No,we don't need the while loop here. As we are using the exiting nodes itself,not creating new ones. Suppose n1 is null, so n2 is left. we pointed temp->next as n2. so, from here, link is maintained up to n2 becomes null. Hope you got this.
@pratiushkumar3306
@pratiushkumar3306 8 ай бұрын
Wait what 😂 he did solved that with if else. Watch it completely before commenting.
@rahulhembram4519
@rahulhembram4519 9 ай бұрын
UnderStood
@ShivaMahajan07
@ShivaMahajan07 8 ай бұрын
God or what
@AkashKumarTiwary-u4b
@AkashKumarTiwary-u4b 5 ай бұрын
god
@Adarsh_agrahari
@Adarsh_agrahari 9 ай бұрын
Done and dusted😅
@aayushgakhar3525
@aayushgakhar3525 6 ай бұрын
free(dummy node):
@cenacr007
@cenacr007 6 ай бұрын
us
@rahulmandal4007
@rahulmandal4007 4 ай бұрын
where the hell is the dummy node concept been spending hours to find but couldn't find it Someone plz pin it
@akshitrajputhere
@akshitrajputhere 4 ай бұрын
mila?
@chinmayraichur8984
@chinmayraichur8984 8 ай бұрын
Understood!
@dewanandkumar8589
@dewanandkumar8589 5 ай бұрын
Understood
@RituSingh-ne1mk
@RituSingh-ne1mk 10 ай бұрын
Understood!
L24. Flattening a LinkedList | Multiple Approaches with Dry Run
32:58
take U forward
Рет қаралды 62 М.
Time and Space Complexity - Strivers A2Z DSA Course
35:16
take U forward
Рет қаралды 662 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,6 МЛН
MAGIC TIME ​⁠@Whoispelagheya
00:28
MasomkaMagic
Рет қаралды 37 МЛН
Всё пошло не по плану 😮
00:36
Miracle
Рет қаралды 6 МЛН
Osman Kalyoncu Sonu Üzücü Saddest Videos Dream Engine 275 #shorts
00:29
L25. Merge K Sorted Lists | Multiple Approaches
30:02
take U forward
Рет қаралды 49 М.
L21. Reverse Nodes in K Group Size of LinkedList
24:31
take U forward
Рет қаралды 97 М.
Merge Two Sorted Lists - Leetcode 21 - Linked Lists (Python)
9:41
Lecture 49: Merge 2 Sorted Linked Lists || Sort 0s, 1s and 2s in Linked List
58:44
Merge two sorted Linked Lists to form a new Sorted Linked List
13:59
Vivekanand Khyade - Algorithm Every Day
Рет қаралды 172 М.
L14. Detect a loop or cycle in LinkedList | With proof and Intuition
20:26
Merge Two Sorted Lists - Leetcode 21 - Python
6:16
NeetCode
Рет қаралды 382 М.
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 2,6 МЛН