L23. Merge two sorted Linked Lists

  Рет қаралды 71,736

take U forward

take U forward

Күн бұрын

Пікірлер: 73
@shubhambhatt2704
@shubhambhatt2704 10 ай бұрын
Bro woke up and dropped the whole playlist
@Hariprasath-bl6dt
@Hariprasath-bl6dt 5 ай бұрын
Turu
@ashwaniagrawal27
@ashwaniagrawal27 9 ай бұрын
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 10 ай бұрын
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 9 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
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 7 ай бұрын
@@ujjwalsingh6889 yes. I realized it later. when I did a dry run. Thanks for replying ujjwal
@rahulmandal4007
@rahulmandal4007 5 ай бұрын
@@anirudhv0062 You need to improve your DSA These are basics
@sohamsonwane1534
@sohamsonwane1534 10 ай бұрын
meri tarf se ik papii supper good explanation
@OrderEmperor
@OrderEmperor 9 ай бұрын
🏳️‍🌈
@robot3.077
@robot3.077 10 ай бұрын
Bhaiya ,I can definitely say, you are god of DSA❤❤
@itsd2388
@itsd2388 10 ай бұрын
Bhaiya when can we expect stack queue playlist
@Mel-up7un
@Mel-up7un 13 күн бұрын
dude you're better than that neetcode guy thank youuuuuuuuu
@jnayehsirine6222
@jnayehsirine6222 8 ай бұрын
we missed youuu here ! KEEP UP THE GREAT WORK YOU'RE DOIN MAN
@rajatraj4297
@rajatraj4297 5 ай бұрын
why this problem is not in the A2Z sheet?
@kirannaik4417
@kirannaik4417 25 күн бұрын
Loved it, bro!
@RAHULSINGH-cd6gl
@RAHULSINGH-cd6gl 10 ай бұрын
On which topic you will be making your next playlist??
@crazyfacts4434
@crazyfacts4434 10 ай бұрын
Very good explanation. 😊😊
@ManojKumar-do1rh
@ManojKumar-do1rh 8 ай бұрын
Thanks ... nice explaination
@samriddhichoubey7832
@samriddhichoubey7832 Ай бұрын
In which lec you've explained the concept of dummy nodee?
@Bhawna-ir1gr
@Bhawna-ir1gr 10 ай бұрын
amazing 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
@m1stnoob201
@m1stnoob201 5 ай бұрын
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 ?
@justsomeguywithoutamustach9978
@justsomeguywithoutamustach9978 5 ай бұрын
To be exact, time complexity would be O(min(n1 + n2)).
@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 7 ай бұрын
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.
@Mel-up7un
@Mel-up7un 13 күн бұрын
But we have to consider the worst case in which we traverse both the linked lists up to the last node
@aakashbhandari9761
@aakashbhandari9761 10 ай бұрын
Welcome Back sir❤🎉
@sujalsingh9365
@sujalsingh9365 10 ай бұрын
Happy New Year 🎉
@priyarajtripathi9952
@priyarajtripathi9952 8 күн бұрын
hey folks, does anyone know what tool he is using to write and draw?
@d.praful
@d.praful 5 ай бұрын
Nice explanation ❤
@abhishekprasad010
@abhishekprasad010 5 ай бұрын
What if I use a multiset instead of an array in brute force approach??
@ddevarapaga5134
@ddevarapaga5134 4 ай бұрын
Best bhai Thank you
@hashcodez757
@hashcodez757 4 ай бұрын
Epic bhaiya!!
@cenacr007
@cenacr007 6 ай бұрын
I couldn't find this question in the a2z playlist.
@adebisisheriff159
@adebisisheriff159 9 ай бұрын
Thanks Striver!!1
@YourCodeVerse
@YourCodeVerse 9 ай бұрын
Understood✅🔥🔥
@DeadPoolx1712
@DeadPoolx1712 2 ай бұрын
UNDERSTOOD;
@musabahmed567
@musabahmed567 8 ай бұрын
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 7 ай бұрын
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 3 ай бұрын
​@@aneeketvispute5063bro If we change temp.next = t2 then how the next node of t1 is not lost Since we're changing the link
@atulwadhwa192
@atulwadhwa192 8 ай бұрын
8:15 Can anyone tell in which video dummy node concrpt is explained by him😅
@No-yp1uv
@No-yp1uv 2 ай бұрын
is this a dynamic programming problem?
@ArpanChakraborty-do6yz
@ArpanChakraborty-do6yz 8 ай бұрын
Awesome 😎 17:36
@NARUTOUZUMAKI-bk4nx
@NARUTOUZUMAKI-bk4nx 10 ай бұрын
Understoood
@nayankhuman1043
@nayankhuman1043 2 ай бұрын
understood :)
@OmkarKudalkar
@OmkarKudalkar Ай бұрын
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
@dewanandkumar8589
@dewanandkumar8589 6 ай бұрын
Understood
@subee128
@subee128 10 ай бұрын
Thanks
@RituSingh-ne1mk
@RituSingh-ne1mk 10 ай бұрын
Understood!
@VibhaJamadagni-hz6ck
@VibhaJamadagni-hz6ck 5 ай бұрын
understood
@ashishpradhan6250
@ashishpradhan6250 4 ай бұрын
Nyc
@nashratjahan9371
@nashratjahan9371 10 ай бұрын
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 10 ай бұрын
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 9 ай бұрын
Wait what 😂 he did solved that with if else. Watch it completely before commenting.
@ShivaMahajan07
@ShivaMahajan07 9 ай бұрын
God or what
@YashGaneriwal-je6rh
@YashGaneriwal-je6rh 3 ай бұрын
done and dusted
@codeman3828
@codeman3828 9 ай бұрын
Undertsood
@Adarsh_agrahari
@Adarsh_agrahari 10 ай бұрын
Done and dusted😅
@AkashKumarTiwary-u4b
@AkashKumarTiwary-u4b 6 ай бұрын
god
@rahulhembram4519
@rahulhembram4519 9 ай бұрын
UnderStood
@aayushgakhar3525
@aayushgakhar3525 6 ай бұрын
free(dummy node):
@rahulmandal4007
@rahulmandal4007 5 ай бұрын
where the hell is the dummy node concept been spending hours to find but couldn't find it Someone plz pin it
@akshitrajputhere
@akshitrajputhere 5 ай бұрын
mila?
@cenacr007
@cenacr007 6 ай бұрын
us
@chinmayraichur8984
@chinmayraichur8984 9 ай бұрын
Understood!
@himanshidafouty347
@himanshidafouty347 5 ай бұрын
Understood
@rajatshukla2605
@rajatshukla2605 Ай бұрын
Understood!
L24. Flattening a LinkedList | Multiple Approaches with Dry Run
32:58
take U forward
Рет қаралды 64 М.
THE TEJAS EXPRESS ON VIKARAM LIVERY WAP7 SCR ROUTE
8:41
Lokesh gaming YT
Рет қаралды 23
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Мама у нас строгая
00:20
VAVAN
Рет қаралды 10 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 133 МЛН
L25. Merge K Sorted Lists | Multiple Approaches
30:02
take U forward
Рет қаралды 52 М.
L26. Sort a Linked List | Merge Sort and Brute Force
22:11
take U forward
Рет қаралды 110 М.
Coding Unbreakable Encryption in C | One-Time Pad
17:42
HirschDaniel
Рет қаралды 4,4 М.
Merge Sorted Arrays Without Extra Space | 2 Optimal Solution
32:47
take U forward
Рет қаралды 215 М.
Understanding and implementing a Linked List in C and Java
18:15
Jacob Sorber
Рет қаралды 245 М.
Lecture 49: Merge 2 Sorted Linked Lists || Sort 0s, 1s and 2s in Linked List
58:44
L5. Add 2 numbers in LinkedList | Dummy Node Approach
14:48
take U forward
Рет қаралды 115 М.
Merge Two Sorted Lists - Leetcode 21 - Linked Lists (Python)
9:41
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН