Clone A Linked List (With Random Pointers) - Linear Space Solution & Tricky Constant Space Solution

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • Free 5-Day Mini-Course: backtobackswe.com
    Try Our Full Platform: backtobackswe....
    📹 Intuitive Video Explanations
    🏃 Run Code As You Learn
    💾 Save Progress
    ❓New Unseen Questions
    🔎 Get All Solutions
    Question: You are given a standard linked list with next pointer BUT each node carries an additional random pointer to any given node in the linked list. Clone the linked list.
    Let us first see the mental barriers and problems that we face while solving this.
    It is trivial to make a copy of the linked list nodes with only the next pointers, but the random pointer on each node presents a problem.
    We will notice that we have trouble establishing the connection between the original linked list and the random pointers between nodes in the cloned linked list.
    Approach 1 (Linear Space Solution)
    Use a hashtable to facilitate the cloning.
    Complexities
    Time: O( n )
    We will perform linear time traversals that keep our asymptotic behavior linear.
    Space: O( n )
    We will store a clone mapping for each node entailing linear space complexity with respect to the original list passed to us.
    Approach 2 (Constant Space Solution)
    Use the original list's node's next pointer to map to the clone list.
    Complexities
    Time: O( n )
    We are still only doing linear time traversals
    Space: O( 1 )
    We do not store any auxiliary space that will scale as the input size gets arbitrarily large.
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    HackerRank: / @hackerrankofficial
    Tuschar Roy: / tusharroy2525
    GeeksForGeeks: / @geeksforgeeksvideos
    Jarvis Johnson: / vsympathyv
    Success In Tech: / @successintech
    ++++++++++++++++++++++++++++++++++++++++++++++++++
    This question on Leetcode: leetcode.com/p...

ความคิดเห็น • 367

  • @BackToBackSWE
    @BackToBackSWE  5 ปีที่แล้ว +25

    Table of Contents:
    Me Talking 0:00 - 0:32
    The Problem Introduction 0:32 - 1:43
    Assessing What We Know 1:43 - 1:59
    Finding Our Mental Barriers 1:59 - 4:09
    The Hashtable Breakthrough 4:09 - 4:47
    Linear Space Solution Walkthrough 4:47 - 9:33
    Can We Do Better? :) 9:33 - 10:55
    Constant Space Solution Walkthrough 10:55 - 16:46
    Wrap Up 16:46 - 17:19
    The code for this question is in the description. Both the linear space and constant space solutions are addressed.

    • @JT-yn4zk
      @JT-yn4zk 4 ปีที่แล้ว +10

      where exactly is the code? I can't seem to see it

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว +1

      The repository is deprecated - we only maintain backtobackswe.com now.

  • @rishabkumar4940
    @rishabkumar4940 3 ปีที่แล้ว +73

    I just got placed in Amazon and I want to extend my deepest thanks to you. You helped me a lot man!! Thank you and all the best for your amazing channel

  • @dirkneuhauser8213
    @dirkneuhauser8213 4 ปีที่แล้ว +16

    Finally someone who likes to explain stuff and who does it enthusiastically. It's a pleasure to watch! !! Thanks ma dud! :)

  • @paul-mw6pc
    @paul-mw6pc 5 ปีที่แล้ว +38

    great stuff, I didn't even understand the question being asked on the leetcode page. Your diagram helped a ton, thank you.

  • @MiddleEasternInAmerica
    @MiddleEasternInAmerica 4 ปีที่แล้ว +6

    so far, that's my favorite video on BackToBackSWE channel, I smile everytime he says "again the code in the description" :)

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว +1

      haha yeah we transitioned to website

  • @yanxichen4236
    @yanxichen4236 5 ปีที่แล้ว +70

    Well, I for one am glad you failed this question for that interview then... am I allowed to say that? lol Great video as always.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +8

      haha

    • @batman_1st
      @batman_1st 5 ปีที่แล้ว +20

      Ben's failure helped people like me, so thank you Ben, pls fail more haha!

  • @MultiPriya28
    @MultiPriya28 4 ปีที่แล้ว +9

    You are the first teacher who has made me fall in love with DS..
    I never thought I would ever dare to solve such kinda problems.. :D I started with quick sort and here I am..
    Great explaination! And to all the followers : Just watch the video in fast forward mode.. !!!! ;D

  • @cryptojeff3993
    @cryptojeff3993 4 ปีที่แล้ว +13

    This is awesome! Clear explanation. Lost my job offer because of coronavirus and preparing for interviews.

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว +2

      Nice, contact us and we can give you a platform membership if you'd like

  • @tapasyak429
    @tapasyak429 2 ปีที่แล้ว

    I just found your channel and hands down this is THE BEST in terms of teaching how to solve a coding problem. Most of the videos I see just have the answer in hand and they try to explain how that answer works. But nobody tries to tell you how to come up with that answer ourselves first with common sense. This video exactly has what other's are lacking. On top of that, see that enthusiasm in that guy. I love him!

  • @sanjanachopra2100
    @sanjanachopra2100 4 ปีที่แล้ว +8

    If not for this video, I wouldn't have understood the question itself. Thank you so much for all your videos☺️

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      ye

    • @seungjinkim8860
      @seungjinkim8860 4 ปีที่แล้ว

      A lot of questions I can't even understand what they're asking lol

  • @vishnuvardhan623
    @vishnuvardhan623 5 ปีที่แล้ว +8

    When I first saw the question,I thought it was just similar to clone graph and other thing is we should not mess up with original linked list pointers.But messing up with original linked list pointers gave the constant space solution😱.Awesome explaination!

  • @RitikSharma-pc5yj
    @RitikSharma-pc5yj 4 ปีที่แล้ว +3

    WOW!! Without this problem, the Linked list are incomplete :) Thanks for whatever you taught us

  • @yvestuyishime5209
    @yvestuyishime5209 4 ปีที่แล้ว +9

    If i get this question for the first time, i would cry!!!

  • @lugiadark21
    @lugiadark21 3 ปีที่แล้ว +1

    When I first read the question I was like WTF I cannot solve this, after seeing your video I was able to code it without looking at the code. Thanks again!! Your videos are the best!!

  • @rishabkumar4940
    @rishabkumar4940 4 ปีที่แล้ว +4

    I was asked this question in an interview today and I got it right just because of you!! Thanks man

  • @dochaar
    @dochaar 4 ปีที่แล้ว +5

    Yet another amazing video Ben! This video might help so many other folks to get across the line at Google, can't thank you enough. Also, quick note, the url to the code doesn't work and seems to have updated since you added two new files into your GIT repo (constant space and linear space). Please update the links so it might help folks going forward :)

  • @mvm9888
    @mvm9888 5 ปีที่แล้ว +5

    Most detailed and effective teaching video I’ve ever seen on TH-cam, thank u, already get used to watching your video when eating, wish I could also someday read my offer from twitter too!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      hahahahaha thank you. Food is very good.

  • @ovoboyz1521
    @ovoboyz1521 4 ปีที่แล้ว +2

    Thanks Ben, you always make complex problems easier to understand! Shoutout from Canada!

  • @remykhayat5763
    @remykhayat5763 5 ปีที่แล้ว +2

    i spent hours trying to do this and even tho the constant space answer is non-trivial you made it very easy to understand, thank you sooo much, i hope i see this question in my next interview

  • @osamaxz5720
    @osamaxz5720 2 หลายเดือนก่อน

    you are one of the best teachers, I solved it in O(n^2) and I don't watch your videos to see the solution as I really watch to see how to think, my thinking was near to yours but surly your is better and helped me a lot of learning how to think in more efficient way, thanks

  • @amospan14
    @amospan14 2 ปีที่แล้ว

    Thank you for failing this interview question and instead of letting it define you as a failure, you used it as motivation to teach all of us. I appreciate it my man! =)

  • @Rendbot
    @Rendbot 5 ปีที่แล้ว +7

    Thanks for all of your videos! Your video helped a lot. Got an offer from amazon!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      👀👀👀 Will u be in Seattle this summer?

    • @Rendbot
      @Rendbot 5 ปีที่แล้ว +1

      My number one preference is Seattle. I get my official offer Tuesday.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      @@Rendbot ok

    • @Paradise-kv7fn
      @Paradise-kv7fn 5 ปีที่แล้ว

      from where did you prepare and how? I have just finished college and will be joining a tier 2 product based company but am planning to switch to the big 4 in the next year or so.

  • @tonybernoulli7859
    @tonybernoulli7859 4 ปีที่แล้ว +1

    This is far more clear than any tutorial I watched on youtube, please make more videos like this

  • @CrazyHunk14
    @CrazyHunk14 4 ปีที่แล้ว +1

    to be really honest i just got stuck with the same problem in my interview. where i was about to discover the constant space solutions but i could not(interview pressure) then i came back to your channel and found out you too. now i am felling well about myself. still i am gonna binge all your videos thanks for helping you are doing a great job.

  • @darshandani1
    @darshandani1 2 ปีที่แล้ว

    Extremely well-explained ! Thank you for walking us over through the entire thought process. I had this question in an interview too and I failed to see all the small issues that you told in the video. Thanks !

  • @kuralamuthankathirvelan
    @kuralamuthankathirvelan 5 ปีที่แล้ว +5

    Perfect explanation bro ! Keep posting more videos !

  • @rajatverma1688
    @rajatverma1688 4 ปีที่แล้ว +2

    Not only I like the way he explains , i love the extra bit of fun he adds to the videos like *door opens ey* mixing tuschar roy videos in between .. fun content ben..

  • @wishfulthinker6139
    @wishfulthinker6139 4 ปีที่แล้ว +1

    Explanation was soo good that i didn't even had to watch the code and was able to code it in one go...i subscribed at lightspeed.

  • @waxylayer8353
    @waxylayer8353 4 ปีที่แล้ว +4

    Second approach is just great 💥 u r a genius !

  • @chengjiang7051
    @chengjiang7051 5 ปีที่แล้ว +2

    I have thought about a few minutes for the solution of constant space but in vain.
    When i saw you set the origin node's next pointer to the mirror node , I suddenly got the key point. hahaha
    Genius! Thx!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +1

      nice haha, I didn't come up with it either, just learned from someone else

    • @shruthib3366
      @shruthib3366 5 ปีที่แล้ว +1

      @@BackToBackSWE Love your modesty here!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +1

      @@shruthib3366 it's tru

  • @sudhanshuuniyal5737
    @sudhanshuuniyal5737 4 ปีที่แล้ว +1

    you are INCREADIBLE BEN.

  • @zihaoyan4741
    @zihaoyan4741 2 ปีที่แล้ว

    This is way more intuitive than most sol on lc. Their algo makes sense but hard to implement when coding for me. your solution is much straight forward and I could come up with exact same answers just after viewing your video!

  • @mrivesingh
    @mrivesingh 4 ปีที่แล้ว +1

    You just made this really simple to understand! Thanks a ton!

  • @meenameiss
    @meenameiss 5 ปีที่แล้ว +2

    You're great at teaching, congratz. Keep going as long as you can

  • @kaustubhdwivedi1729
    @kaustubhdwivedi1729 3 ปีที่แล้ว +1

    Can't get a better explanation 🤯

  • @r1jsheth
    @r1jsheth 5 ปีที่แล้ว +3

    BIG thumbs up!! Loved the way you teach!

  • @KevinJohnMulligan
    @KevinJohnMulligan 2 ปีที่แล้ว

    From 5:51 you did a kind of stop frame animation thing with the video editing which was super satisfying to watch and the narration mapped perfectly too 👌

  • @ankurgupta4696
    @ankurgupta4696 4 ปีที่แล้ว

    Your are One of the best teachers on youtube , i learn so much from you

  • @mohinim.1654
    @mohinim.1654 4 ปีที่แล้ว +2

    Awesome video! It would be really helpful, if you could put code in either description or github.

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว +1

      thanks and the repository is deprecated - we only maintian backtobackswe.com's solutions.

  • @duranraprez
    @duranraprez 4 ปีที่แล้ว +10

    This blew my mind lol

  • @ogetysaivamsi106
    @ogetysaivamsi106 4 ปีที่แล้ว +1

    Thank you for making it very simple to understand.

  • @illiakailli
    @illiakailli ปีที่แล้ว

    thanks for a nice explanation! I can definitely see an improvement over the hashtable version. The only thing that’s not clear is why last solution is ‘constant space’, when you had to create N clones in addition to the original array?

    • @Tasarran
      @Tasarran ปีที่แล้ว

      That's the product that is being asked for, it is understood that at least that much space will be taken up.
      What he means is that it doesn't create any EXTRA space that would have to be garbage collected in some way.

  • @cristianouzumaki2455
    @cristianouzumaki2455 3 ปีที่แล้ว

    I have come here thrice for the same question, not because I didn't understand the question but because I keep forgetting this trick. Also his explanations are always very good .

  • @manvityagi6529
    @manvityagi6529 4 ปีที่แล้ว +2

    I wish! You did not deprecate the existing repository at least, even if you shifted things to backtobackswe.com. It was really helpful. :(

  • @cesaredecal2230
    @cesaredecal2230 5 ปีที่แล้ว +2

    Finally understood this. Thank you!

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      NO. FREAKING. WAY. WHAT. Wassup Cesare hahahahahaha

    • @cesaredecal2230
      @cesaredecal2230 5 ปีที่แล้ว +1

      @@BackToBackSWE Haha back to the interview game and you come to my rescue

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      @@cesaredecal2230 lmao, good luck

  • @svdfxd
    @svdfxd 5 ปีที่แล้ว +1

    Awesome explanation and beautiful way of rewiring nodes in the LinkedLists.

  • @shivanshrawat2688
    @shivanshrawat2688 4 ปีที่แล้ว +1

    Brilliant explanation. I have a small question if we are creating copies of N nodes how is this constant space?(the second approach)
    We have to create N more Nodes everytime, pardon me but i am a little confused.

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      We often leave the space of the copied list out and only attest to the space allocation of the algorithm asymptotically (since the copy space usage is trivially understood). Either is common.

    • @shivanshrawat2688
      @shivanshrawat2688 4 ปีที่แล้ว

      @@BackToBackSWE So if create another list with N nodes or create N copies of all the nodes it wont increase space complexity? Space complexity will only increase if we use another data structure and add n items to it like a hash table or array or Map?

  • @a.yashwanth
    @a.yashwanth 4 ปีที่แล้ว +2

    You should've explained step-3 too i.e., restoring the 2 linked lists. It took me lot of time to understand that part. Other than that great video.

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว +1

      ok

    • @a.yashwanth
      @a.yashwanth 4 ปีที่แล้ว

      @@BackToBackSWE Are you a frikin robot? How can you have time to reply to every single comment?
      Never seen someone do that.

    • @isha2567
      @isha2567 4 ปีที่แล้ว

      Exactly! @Ande, could you explain the restoring part or share the code associated with it

  • @goodwish1543
    @goodwish1543 4 ปีที่แล้ว +1

    Wonderful. Good illustration, easy to understand.
    I found the solution similar to clone graph. And learned O(1) space solution, as you said, just for knowing it exists.

    • @goodwish1543
      @goodwish1543 4 ปีที่แล้ว +1

      It only took me first couple minutes to understand each solution, very good teaching.

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      ye

  • @veeralsharma6748
    @veeralsharma6748 4 ปีที่แล้ว +2

    best explanation for this question out there

  • @gulshansingh3933
    @gulshansingh3933 4 ปีที่แล้ว +1

    Awesome stuff dude

  • @tapasu7514
    @tapasu7514 5 ปีที่แล้ว +1

    Best Explanation Ever ! Thanks for all the great videos

  • @mahadreamz
    @mahadreamz 3 ปีที่แล้ว

    Great stuff. You said code is in the description. Where is it?

  • @scodz2007
    @scodz2007 4 ปีที่แล้ว +1

    You ROCK bro, keep up the good work!

  • @pushpendrasingh1819
    @pushpendrasingh1819 5 ปีที่แล้ว +2

    I have watched every single video of yours and loved it. My DS skills have definitely improved but
    Can you please make a video on general web architecture (People know the basic like there is DNS then load balancer then web server etc..) but how these things work in real-time(like how DNS gets resolved, where does load balancer lies. what is web server, do we make one our own or do we use existing open course).
    Please, Please make a 1-hour long video explaining every part from a practical point of view (no theoretical).
    (Most of the time interview asks details of these things (also Http vs rest vs Webservices.. I have read a number of articles about them but didn't find any clear cut answer) and we get stuck because we have read the theory)
    I am early waiting for your answer brother

  • @gurleenkaur5786
    @gurleenkaur5786 5 ปีที่แล้ว +1

    Really great explanation and thanks for providing the code!!

  • @mmfawzy4850
    @mmfawzy4850 4 ปีที่แล้ว +1

    Boss, could you please check the code page, it is not available, and as always thaaaanks for the great explanation 👍🏼👍🏼👍🏼

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      sure

    • @deveshjha5141
      @deveshjha5141 4 ปีที่แล้ว

      found it from his github github.com/bephrem1/backtobackswe/blob/master/Linked%20Lists/CloneLinkedListWithRandomPointers/LinearSpace.java

  • @prithazz
    @prithazz 4 ปีที่แล้ว +1

    You are an amazing teacher!

  • @SuprBrian64
    @SuprBrian64 3 ปีที่แล้ว

    Great Explanation!

  • @sophiehall38
    @sophiehall38 5 ปีที่แล้ว +6

    Can't believe that I have watched this video and I still can't remember how to solve this problem.

  • @ashwiniabhishek1504
    @ashwiniabhishek1504 4 ปีที่แล้ว +1

    Great video thanks

  • @gamberril
    @gamberril 4 ปีที่แล้ว +1

    Very good explanation, thanks !

  • @mohitbhatia1994h
    @mohitbhatia1994h 5 ปีที่แล้ว +1

    Great and elegant explanation.

  • @kharinskiyalexey7409
    @kharinskiyalexey7409 5 ปีที่แล้ว +1

    Why not just clone LL within the first pass with connections and iterate through both of the lists to restore the random pointers? Constant time access is great ofc, but I think there is a trade off between time complexity, space complexity and readability. The second one is quite tricky, why should I prefer it against the simplest one? Ofc it depends on the interviewer's thoughts:) Thank you for great explanation, anyway.

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +1

      i agree, depends on what matters more to you/the interviewer

  • @snehalahire1194
    @snehalahire1194 4 ปีที่แล้ว +1

    This is such an amazing explanation . Where is the link to the code?

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      The repository is deprecated, we only maintain backtobackswe.com now.

  • @CHIRANJIBNANDY1
    @CHIRANJIBNANDY1 5 ปีที่แล้ว +1

    I am little confused. Might be very trivial and a silly question to ask. Does not the constant space mean extra spaces/nodes we create in memory ? If that's the case we created / cloned all the nodes in the first pass of our constant space solution. Please correct me, what am I missing ?

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      Yes, that is correct, but we are not counting the output space

  • @j.c9858
    @j.c9858 4 ปีที่แล้ว +3

    Thank you for helping me out, it is the problem failed me in the most recent interview...could you please share the code again? seems the shared link has expired...appreciate!

  • @canaDavid1
    @canaDavid1 4 ปีที่แล้ว +2

    What i think pre-watching the video:
    Go trough the list, write down all the addresses of nodes. For each address, make new space in memory and write it down. Now go trough the list again. The data is stored at the address specified, and the pointers are run through it to find new values.

  • @Max-zf5ot
    @Max-zf5ot 5 ปีที่แล้ว +1

    You are an amazing teacher !!!!

  • @shravyaramesh6040
    @shravyaramesh6040 5 ปีที่แล้ว +2

    This is beautiful and you are amazing.

  • @kunqian06
    @kunqian06 4 ปีที่แล้ว +1

    Just awesome as usual. Bravo!

  • @alexanderchao5389
    @alexanderchao5389 3 ปีที่แล้ว

    This is such a beautiful explanation!

  • @cunghocthuattoan7869
    @cunghocthuattoan7869 4 ปีที่แล้ว +2

    I could not find the code in the description. Can someone help me?

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      The repository is deprecated - we only maintain backtobackswe.com now.

  • @tewodroswolde9830
    @tewodroswolde9830 4 ปีที่แล้ว +1

    Thanks for posting Ben! Arif sira newu. Berta!

  • @vivekgr3001
    @vivekgr3001 4 ปีที่แล้ว +1

    good explanation

  • @xavierelon
    @xavierelon 4 ปีที่แล้ว +1

    Hey man, awesome explanation. Just a little hard to follow since the code is no longer available

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      thanks and yes, the repository is deprecated - we only maintain backtobackswe.com now.

    • @xavierelon
      @xavierelon 4 ปีที่แล้ว

      Back To Back SWE by that do you mean the code is located on your website? Also thank you for the reply

  • @AmeyaKherodkar
    @AmeyaKherodkar 4 ปีที่แล้ว +1

    Very Nice Explaination (Y) and the efforts you take to make yours viewer understand (Y)

  • @udaykiran9623
    @udaykiran9623 4 ปีที่แล้ว +2

    Bro always you are telling code is in the description.where is the code broo
    I cant even seen for one vedio of yourss

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      The repository is deprecated - we only maintain backtobackswe.com now.

  • @fannnatic
    @fannnatic 4 ปีที่แล้ว +1

    awesome. thank you

  • @xinyuyou7512
    @xinyuyou7512 5 ปีที่แล้ว +2

    Really great explication. Thank you!

  • @xiuwenzhong7375
    @xiuwenzhong7375 5 ปีที่แล้ว +7

    The O(1) space confused me, the first time I got this question, my answer is to use a hashmap, but when I saw O(1) space, i am afraid to say my answer. lol

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว +1

      yeah, I couldn't have gotten it

  • @subhangijena4381
    @subhangijena4381 4 ปีที่แล้ว +1

    Best explanation of this question.

  • @MithleshKumar-iz1dz
    @MithleshKumar-iz1dz 5 ปีที่แล้ว +2

    Great, great, great!

  • @alperozdamar517
    @alperozdamar517 4 ปีที่แล้ว +1

    Amazing solution. I liked it. Very easy to understand and implement. Thank you. :)

  • @Alex-wy2ko
    @Alex-wy2ko 4 ปีที่แล้ว +1

    great video! lots of thanks!

  • @arbazshaikh4447
    @arbazshaikh4447 4 ปีที่แล้ว +2

    I can`t find the link for the code in description ?

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว +1

      The repository is deprecated - we only maintain backtobackswe.com now.

  • @SarabjotSingh294
    @SarabjotSingh294 3 ปีที่แล้ว

    Really amazing explanation!!!! Thanks!

  • @alitherland765
    @alitherland765 3 ปีที่แล้ว +1

    Where do I find the code? I cannot find it.

  • @shwetasharma-hz3ib
    @shwetasharma-hz3ib 4 ปีที่แล้ว +1

    thank you, you made it look so easyyyyyyy......

  • @kaustubhchaturvedi658
    @kaustubhchaturvedi658 3 ปีที่แล้ว

    why is space complexity O(1) for the 2nd approach?
    We are declaring n new node containers for n existing nodes. So the auxiliary space will scale up as input size increases.

  • @ankababuyou
    @ankababuyou 4 ปีที่แล้ว +2

    Link to code in the description is broken. Can you please look into that?

  • @AshishSingh-dn8wb
    @AshishSingh-dn8wb 4 ปีที่แล้ว +3

    Great video!
    In your description you gave misspelled Tushar Roy as Tuschar Roy. ( or is that a programming joke cause of the data type "char" you know :3)

  • @sukritkapil2562
    @sukritkapil2562 4 ปีที่แล้ว +1

    Just Wow! Thanks a lot!!

  • @AbhishekSingh-fc6tb
    @AbhishekSingh-fc6tb 4 ปีที่แล้ว +2

    Brilliant way!

  • @davidj2597
    @davidj2597 4 ปีที่แล้ว +1

    Thanks man, you are so helpful

  • @ganeshms4624
    @ganeshms4624 5 ปีที่แล้ว +1

    I like your videos. I understand the concepts well but for the code, I follow only C++. Can you provide the C++ versions of the same code for the videos too in the description?

    • @BackToBackSWE
      @BackToBackSWE  5 ปีที่แล้ว

      I cannot because I don't know C++ proficiently and do not have the time. I'd love if you contributed some samples though, the repo is open for anyone to contribute.

  • @abhishekkumarjaiswal1507
    @abhishekkumarjaiswal1507 3 ปีที่แล้ว

    great explanation sir

  • @mayurkoli4145
    @mayurkoli4145 4 ปีที่แล้ว +2

    Just Want to huge you my friend. #StayHome

  • @indranilthakur3605
    @indranilthakur3605 4 ปีที่แล้ว +2

    Where is the code in your description? I can't seem to find it.

    • @BackToBackSWE
      @BackToBackSWE  4 ปีที่แล้ว

      The repository is deprecated - we only maintain backtobackswe.com now.

  • @Metachief_X
    @Metachief_X 4 ปีที่แล้ว +1

    Great stuff dude!!!!