Тёмный

L23. Merge two sorted Linked Lists 

take U forward
Подписаться 671 тыс.
Просмотров 57 тыс.
50% 1

Problem Link: bit.ly/3vjuaGQ
Entire LL Sheet: takeuforward.o...
Check our A2Z DSA Course: takeuforward.o...
Please do give us a like, and subscribe to us if you are new to our channel.
Do follow us on our socials: linktr.ee/take...

Опубликовано:

 

16 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 65   
@shubhambhatt2704
@shubhambhatt2704 8 месяцев назад
Bro woke up and dropped the whole playlist
@Hariprasath-bl6dt
@Hariprasath-bl6dt 2 месяца назад
Turu
@ashwaniagrawal27
@ashwaniagrawal27 7 месяцев назад
Definittely this is one of the best playlist on linked list in youtube.
@SaiSumanthKovuru
@SaiSumanthKovuru 8 месяцев назад
best series i have ever seen especially the dry run thank u so much for an exceptional series
@user-ds2ls5mf7r
@user-ds2ls5mf7r 8 месяцев назад
Great video, --> This video is not updated in the SDE sheet and in the Article as well.
@neerkhandor5007
@neerkhandor5007 8 месяцев назад
Byfar the best linked list series Thank you very much Raj Bhaiya
@jnayehsirine6222
@jnayehsirine6222 6 месяцев назад
we missed youuu here ! KEEP UP THE GREAT WORK YOU'RE DOIN MAN
@amarpalji
@amarpalji 7 месяцев назад
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 5 месяцев назад
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 4 месяца назад
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 4 месяца назад
@@ujjwalsingh6889 yes. I realized it later. when I did a dry run. Thanks for replying ujjwal
@rahulmandal4007
@rahulmandal4007 2 месяца назад
@@anirudhv0062 You need to improve your DSA These are basics
@robot3.077
@robot3.077 7 месяцев назад
Bhaiya ,I can definitely say, you are god of DSA❤❤
@sohamsonwane1534
@sohamsonwane1534 7 месяцев назад
meri tarf se ik papii supper good explanation
@OrderEmperor
@OrderEmperor 7 месяцев назад
🏳️‍🌈
@itsd2388
@itsd2388 8 месяцев назад
Bhaiya when can we expect stack queue playlist
@rajatraj4297
@rajatraj4297 3 месяца назад
why this problem is not in the A2Z sheet?
@Bhawna-ir1gr
@Bhawna-ir1gr 8 месяцев назад
amazing explanation ✨✨
@crazyfacts4434
@crazyfacts4434 8 месяцев назад
Very good explanation. 😊😊
@ddevarapaga5134
@ddevarapaga5134 Месяц назад
Best bhai Thank you
@hashcodez757
@hashcodez757 2 месяца назад
Epic bhaiya!!
@ManojKumar-do1rh
@ManojKumar-do1rh 5 месяцев назад
Thanks ... nice explaination
@d.praful
@d.praful 3 месяца назад
Nice explanation ❤
@nayankhuman1043
@nayankhuman1043 День назад
understood :)
@aakashbhandari9761
@aakashbhandari9761 8 месяцев назад
Welcome Back sir❤🎉
@justsomeguywithoutamustach9978
@justsomeguywithoutamustach9978 2 месяца назад
To be exact, time complexity would be O(min(n1 + n2)).
@YourCodeVerse
@YourCodeVerse 7 месяцев назад
Understood✅🔥🔥
@chinmayraichur8984
@chinmayraichur8984 7 месяцев назад
Understood!
@adebisisheriff159
@adebisisheriff159 7 месяцев назад
Thanks Striver!!1
@atulwadhwa192
@atulwadhwa192 6 месяцев назад
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 4 месяца назад
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.
@himanshidafouty347
@himanshidafouty347 2 месяца назад
Understood
@ArpanChakraborty-do6yz
@ArpanChakraborty-do6yz 5 месяцев назад
Awesome 😎 17:36
@RAHULSINGH-cd6gl
@RAHULSINGH-cd6gl 8 месяцев назад
On which topic you will be making your next playlist??
@m1stnoob201
@m1stnoob201 3 месяца назад
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 7 месяцев назад
Understoood
@VibhaJamadagni-hz6ck
@VibhaJamadagni-hz6ck 3 месяца назад
understood
@dayashankarlakhotia4943
@dayashankarlakhotia4943 8 месяцев назад
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
@subee128
@subee128 8 месяцев назад
Thanks
@sujalsingh9365
@sujalsingh9365 8 месяцев назад
Happy New Year 🎉
@cenacr007
@cenacr007 4 месяца назад
I couldn't find this question in the a2z playlist.
@No-yp1uv
@No-yp1uv 15 дней назад
is this a dynamic programming problem?
@abhishekprasad010
@abhishekprasad010 3 месяца назад
What if I use a multiset instead of an array in brute force approach??
@atulwadhwa192
@atulwadhwa192 6 месяцев назад
8:15 Can anyone tell in which video dummy node concrpt is explained by him😅
@musabahmed567
@musabahmed567 5 месяцев назад
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 5 месяцев назад
ACTUALLY ITS LIKE VARIABLE DECLARATION .
@aneeketvispute5063
@aneeketvispute5063 Месяц назад
we are not creating a new node we are just declaring it like a temp node
@karthikeyan.s2565
@karthikeyan.s2565 Месяц назад
​@@aneeketvispute5063bro If we change temp.next = t2 then how the next node of t1 is not lost Since we're changing the link
@YashGaneriwal-je6rh
@YashGaneriwal-je6rh Месяц назад
done and dusted
@ashishpradhan6250
@ashishpradhan6250 2 месяца назад
Nyc
@codeman3828
@codeman3828 6 месяцев назад
Undertsood
@nashratjahan9371
@nashratjahan9371 8 месяцев назад
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 7 месяцев назад
No need for while loop , see the video 11:40
@md.ualiurrahmanrahat2400
@md.ualiurrahmanrahat2400 7 месяцев назад
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 6 месяцев назад
Wait what 😂 he did solved that with if else. Watch it completely before commenting.
@aayushgakhar3525
@aayushgakhar3525 4 месяца назад
free(dummy node):
@ShivaMahajan07
@ShivaMahajan07 7 месяцев назад
God or what
@AkashKumarTiwary-u4b
@AkashKumarTiwary-u4b 4 месяца назад
god
@rahulhembram4519
@rahulhembram4519 7 месяцев назад
UnderStood
@Adarsh_agrahari
@Adarsh_agrahari 8 месяцев назад
Done and dusted😅
@cenacr007
@cenacr007 4 месяца назад
us
@rahulmandal4007
@rahulmandal4007 2 месяца назад
where the hell is the dummy node concept been spending hours to find but couldn't find it Someone plz pin it
@akshitrajputhere
@akshitrajputhere 2 месяца назад
mila?
@dewanandkumar8589
@dewanandkumar8589 4 месяца назад
Understood
@RituSingh-ne1mk
@RituSingh-ne1mk 8 месяцев назад
Understood!
Далее
L26. Sort a Linked List | Merge Sort and Brute Force
22:11
L21. Reverse Nodes in K Group Size of LinkedList
24:31
L22. Rotate a LinkedList
12:10
Просмотров 61 тыс.