Lecture 52: Clone a Linked List with Random Pointers || C++ Placement Course

Поділитися
Вставка
  • Опубліковано 16 гру 2024

КОМЕНТАРІ • 276

  • @sangrambiradar9461
    @sangrambiradar9461 2 роки тому +156

    Hello guys, it doesn't matter how smart or dumb or lucky you are, if you are consistent enough you can outwork all the people who you think are talented or smarter than you.
    #consistancy #linked list

    • @VsEdits59
      @VsEdits59 2 роки тому +6

      🙂yeah man u are right

  • @todayscreator8662
    @todayscreator8662 2 роки тому +31

    Bhaiya linked list m thoda sa confusion hora tha starting m par fir do teen video dekhne k baad ab maje aa rhe h linked list k questions karne m

  • @suyashjain3223
    @suyashjain3223 Рік тому +28

    3 different Approaches for Single Question. Itna to koi paid courses me bhi nhi btata .Thanks a lot bhaiyaa ❤❤❤

  • @shikharverma5824
    @shikharverma5824 2 роки тому +235

    we know you are observing a constant decline in views,but its just because we are left behind and your content is amazing,Thanks for creating the content and for your efforts

  • @piyushsharma6505
    @piyushsharma6505 2 роки тому +21

    No one can match the commitment and dedication of Love Bhaiya towards teaching and making sure we comprehend the concept easily

  • @ayushkushwaha171
    @ayushkushwaha171 2 роки тому +18

    Maine khud se bhi kaafi socha for any brute force approach. I was very close to the solution that u provided. Really felt amazing by my improvement. Thanks bhaiya!

  • @dudamneerajdattu1459
    @dudamneerajdattu1459 4 місяці тому +3

    33:04 after listening to this approach, i was like 🤯🤯, aisa kaise soch bhi sakthaa hai

  • @suvigyabasnotra7378
    @suvigyabasnotra7378 2 роки тому +6

    sections of code to the original diagram/ approach you've made on the iPad...? Requesting this because it gets unnecessarily hard to visualize all the code so fast mentally!
    In other words, explain each of the lines of different sections of code, comparing it with the iPad approach after you're done coding. Explain like... this line is doing this and this one is doing this, back in the approach rather than just simply wafting over the sections like at 54:07 which we already understand. This method of teaching would really help and prove to be icing on the cake for a lot of us. Thanks for your consistent efforts!

  • @harsh55
    @harsh55 2 роки тому +1

    pheli bar gfg pe love bhai ka solution dekhe bina one shot mein probelm nikal li (of course approach 1 se) . Inutution a raha hai . Thank you! you rock

  • @computerguy3550
    @computerguy3550 Рік тому +1

    BHAIYA JI BOHOT TEZZ BOHOT HI JADDA BADIYA APPROACH 3 MAZA HI AHHHGYA,
    APPKI ENERGY EK ALAG HI LEVEL HAI THANKS BHAI.👌👌👌👌

  • @eshaanpandey7353
    @eshaanpandey7353 2 роки тому +7

    Hashmap solution was easily understandable, I won't remember Approach 3

  • @prashantbirajdar9271
    @prashantbirajdar9271 2 роки тому +2

    wahh bhiyaa maja aa gyaa..❤ sub smaj aa gya hume 🤩🤩👍👍

  • @atharvakadam4701
    @atharvakadam4701 2 роки тому +5

    Though the video was long but I couldn't get such a great explanation in any UA-cam video! great content.

  • @Mb-nr5nz
    @Mb-nr5nz 2 роки тому +1

    Aapka content itna acha hai bhaiya ki aisa lag raha hai aap placement laga ke hi chodoge , waise abhi aaphi ka video dekh raha tha pointers wala , kya easily samjhaya hai , thanks big brother ❤️

  • @Ayush_.
    @Ayush_. 2 роки тому +4

    i watched this video 2 times 🤩🤩fir bhi borring nhi laga just bcz of your amazing explaination bhaiya 🔥🙌

  • @JatinKumar-w7f
    @JatinKumar-w7f 9 місяців тому +1

    class was really amazing and I felt it very cool in coding, Thanks sir for this one and truly speaking, This is the first time that I am saying someone thanks for this kind of teaching. Thanks to make these video and it is helping me a lot in getting my goals.😊😊😊😊

  • @ankitsaha675
    @ankitsaha675 2 роки тому +1

    Shaaandaaar series chal rha h bhaiya. 🔥🔥

  • @aryansen2410
    @aryansen2410 7 місяців тому +1

    solid lecture babbar bhaiya

  • @saurabhrajput7492
    @saurabhrajput7492 2 роки тому +1

    Pahale linked list mere faad dete the ab me linked list ki faad deta hu...time change bro ||......LOVE YOU BRO.........||

  • @varun-qm3xj
    @varun-qm3xj 2 роки тому +1

    pushing limits... last approach me maza he aagai bhaiya code krne me

  • @anushkayachit
    @anushkayachit 2 роки тому +2

    mai to kal mazaak me boli thi video chahiye.... aapne to sach me daaldi... kya aadmi ho yarr 😂😂 chalo anyway.... thank you🖤🖤

  • @kpsingh2647
    @kpsingh2647 Рік тому +2

    Rula diya is question ne

  • @Spike_104
    @Spike_104 Рік тому +2

    51:25 nahi aa sakta upar waale logic me temp->next me NULL. Kyunki temp traverse to original list ke element ko kar raha hai aur Har original node ke baad uska clone node toh ana mandatory hai to temp -> next kabhi bhi NULL nahi hoga kyunki wo humesa apne clone ke counterpart ko point karega.

  • @singhharsh8019
    @singhharsh8019 2 роки тому +4

    Thank you bhaiya for providing nicest dsa content and it's quality is just the best out there....No other course even come close to the simplicity and quality of this content....so thank you again and keep going

  • @shiriii-x9h
    @shiriii-x9h 2 роки тому +11

    Love this course🥰...
    live talk se motivation => reminding to be consistent in course😇

  • @iEntertainmentFunShorts
    @iEntertainmentFunShorts 2 роки тому +2

    Bhaiya m thoda peeche chal rha tha qki Maine 450 and leetcode k problems bhi lagayei Linked list pr toh frequency slow mat krna, map wali approach toh Maine khud se sochi thy but jo 3rd approach thy that was like 🔥🔥
    PS: Thank you so much bhaiaya this question was like🔥

  • @haiderali0801
    @haiderali0801 2 роки тому +2

    Bhaiya awesome....
    Bht maza aa rha.....❤️

  • @prathyyyyy
    @prathyyyyy 2 роки тому +3

    nice vid keep doing and also take care of your health! you've been working hard!!

  • @ayushp4471
    @ayushp4471 2 роки тому +3

    Loved this course ❤❤
    Thank you Bhaiya🔥🔥

  • @uttamkesarwani6143
    @uttamkesarwani6143 2 роки тому +12

    We need Handwritten Notes rest of Lectures, It's really time savings.
    When we have to revise, then I think all of us use that beautiful Notes.
    Otherwise it again a long time to see video again.

  • @keshavgambhir9894
    @keshavgambhir9894 2 роки тому +3

    Amazing approach bhaiya 🔥🔥🔥
    Thanks for video 🙏🙏🙏🙏

  • @dhanushsingh9541
    @dhanushsingh9541 4 місяці тому

    Best DSA series out there thank you for this😊

  • @suvigyabasnotra7378
    @suvigyabasnotra7378 2 роки тому +6

    24:06 arb = arbitrary.

  • @keshavarya7918
    @keshavarya7918 2 роки тому

    Sahi video bana di 👍👍.......isme rehti thi mujhe thoda confusion

  • @deepaklavate4165
    @deepaklavate4165 2 роки тому +1

    High effort and high quality content
    Thank you bhaiyyq

  • @fahadabdullah687
    @fahadabdullah687 2 роки тому +2

    babbar bhai absolutely loved loved loved.... the way you built it...Just one thing, please don't use red to write things down on dark background...use some other colors which make contrast better and readable.

  • @ravivishvas3676
    @ravivishvas3676 2 роки тому +5

    thanks for giving the amazing content in amazing way

  • @KratosProton
    @KratosProton 2 роки тому +1

    Crystal clear explanation bhai!

  • @aayushgoswami8632
    @aayushgoswami8632 Рік тому +4

    Hiii.. just one suggestion -> at 46:40 you can also use
    while(temp != NULL){
    if(temp -> arb != NULL){
    temp -> next -> arb = temp -> arb -> next;
    }
    else{
    temp -> next -> arb = temp -> arb;
    }
    temp = temp -> next -> next;
    }
    because temp -> next won't be equal to NULL ever.

    • @sagardebnath8842
      @sagardebnath8842 Рік тому

      Correct ✅

    • @akshatmalviya8563
      @akshatmalviya8563 11 місяців тому

      Yes , the condition of temp->next getting NULL will never be true . We can remove also

  • @ujjwalverma_
    @ujjwalverma_ 2 роки тому +1

    Consistency++
    Maja aa rha boht, Enjoying this course

  • @suvigyabasnotra7378
    @suvigyabasnotra7378 2 роки тому +8

    Could understand the 2nd approach but not the code like around 22:18 . In the next ones, can you please explain each line of code back in the diagram on the iPad once you're done coding...? Because it gets harder to visualize so much code mentally and ultimately hard to keep track of what step does what behind the scenes.

    • @himanshu_1422
      @himanshu_1422 2 роки тому +1

      class Solution {
      private:
      //insert function for inserting nodes in clone list
      void insert(Node* &head , Node* &tail , int data){
      Node*temp = new Node(data);
      if(head == NULL){
      head = temp;
      tail = temp;
      return ;
      }

      else{
      tail->next = temp;
      tail = temp;
      }
      return;
      }
      public:
      Node* copyRandomList(Node* head) {
      Node* temp = head;
      Node* clonehead = NULL , *clonetail = NULL;
      while(temp!=NULL){
      int data = temp->val;
      insert(clonehead , clonetail , data);
      temp = temp->next;
      }

      map mp;
      temp = head;
      Node* p =clonehead;

      while(temp!=NULL && p!=NULL){
      mp[temp] = p;
      temp = temp->next;
      p = p->next;
      }

      p = clonehead;
      temp = head;

      while(p!=NULL && temp!=NULL){
      p->random = mp[temp->random];
      temp=temp->next;
      p = p->next;
      }

      return clonehead;
      }
      };

  • @arhamhasan9474
    @arhamhasan9474 Рік тому

    Incredibly well explained, and the last approach is lit🔥

  • @shreyanshthakur5405
    @shreyanshthakur5405 2 роки тому +8

    Hey guys, do you guys code along with bhaiya and submit the solution Or you code by self after watching the lecture ? Just curious about different study approaches.

  • @mukeshkaser3077
    @mukeshkaser3077 2 роки тому +1

    Attendence done bhaiya 🙌🏼

  • @kurma3992
    @kurma3992 Рік тому +1

    Great bhaiya❤

  • @yadvibhalla5392
    @yadvibhalla5392 2 роки тому +1

    Best DSA course

  • @PriyanshuSrivastava11fig
    @PriyanshuSrivastava11fig 2 роки тому +1

    present bhaiya !!! awesome series ❤️❤️❤️

  • @utkarshsingh1457
    @utkarshsingh1457 2 роки тому

    Sab samajh aagya..thanks for the video!!

  • @funwithrayhan9579
    @funwithrayhan9579 Рік тому

    masterclass bhai.. love from BD

  • @AA-wy9vw
    @AA-wy9vw 2 роки тому +1

    Loving the series.

  • @adityacreator524
    @adityacreator524 День тому

    Thank you bhaiya bahut achche se explain kiye 🫡

  • @prashantagarwal2455
    @prashantagarwal2455 2 роки тому +1

    Nice explanation of such a topic😭😭

  • @vivan1852
    @vivan1852 2 роки тому

    Bhaiya aapki consistency op hai ...

  • @fnGamingz
    @fnGamingz 2 роки тому

    bhai log jo log view kar rhe ho, kam se kam like to karte jao, kuch to support karo yaar, humbble request.
    Thanks

  • @pranavthakur7471
    @pranavthakur7471 2 роки тому

    present hai bhaiya. but abi mai series follow nhi kr pa raha hu,due to some reason but aap videos daalte rhna........ mai yahi se padhunga..bhaiya...thank you so much

  • @adityatripathi931
    @adityatripathi931 2 роки тому +1

    Attendance done♥️

  • @laksheybanga8106
    @laksheybanga8106 2 роки тому

    Bhaiyaaaa i m your big fan ❣️❣️❣️😭... I swear... Thanks alot ❣️

  • @avin_gaur
    @avin_gaur 6 місяців тому +2

    whole day spent in this (skill issue)

  • @ekengineer9868
    @ekengineer9868 2 роки тому +10

    Consistency++
    Motivation girne nahi deni✊
    I'm lagging a bit in lectures but will be there soon✌️

  • @RohitRana-tz2lr
    @RohitRana-tz2lr 2 роки тому

    Thanks bhaiya for this explaining this amazing question... mja hi aa gya aapse ye question samajkr

  • @kunalsehgal8036
    @kunalsehgal8036 2 роки тому +2

    bhaiya you are brilliant..... this is the first time for me when i guessed approach3 accurately.
    seriously this series is very helpful and content quality is very very good from basics to advance.
    keep it up!!
    Thankyou

  • @VishnuJha-fj2bj
    @VishnuJha-fj2bj 5 місяців тому

    last method was just wow loved the explanation. thankyou so much bhaiya

  • @codeplug
    @codeplug 2 роки тому

    approach 3 was awesome bhai!

  • @RohitSingh-hc8yi
    @RohitSingh-hc8yi Рік тому +3

    Attendance marked

  • @sukhjitsingh959
    @sukhjitsingh959 2 роки тому +2

    41.6 time ..... can't read the line because using colour to write ...I am watching every vedio and only the could not do much practice of these problems .....I am doing covering every problem and want to do more practice by solving concern ing problem on leet code ...what is about 450 questions to solve while practicing theses questions ..will be more better .?

  • @The_Shubham_Soni
    @The_Shubham_Soni Рік тому +1

    Concept++ 🔥🔥

  • @udaypratapsingh8923
    @udaypratapsingh8923 2 роки тому

    love u babbar bhaiyaa

  • @rachit_joshi
    @rachit_joshi 9 місяців тому

    Thank You So Much BHRATA SHREE !!!!!

  • @prachiharley
    @prachiharley 2 роки тому

    kafi asan banaya apne yeh...

  • @poojayadav695
    @poojayadav695 2 роки тому +1

    THANKYOU FOR THE COURSE.................................

  • @fazerugbrug439
    @fazerugbrug439 2 роки тому +1

    content is love

  • @vyankateshzawar7999
    @vyankateshzawar7999 Рік тому

    maza aagaya bhai approch sunke

  • @suvigyabasnotra7378
    @suvigyabasnotra7378 2 роки тому +2

    At 37:38
    What's the difference between
    OriginalNode -> next = CloneNode ; ---( 1 )
    and
    CloneNode = OriginalNode -> next; ---( 2) ??? 🤔
    How do I say both (1) and (2) to myself in Hindi mentally...?

    • @anant-strong
      @anant-strong 2 роки тому

      originalnode ka next clonenode ko point krr raha h and second point me clone node , originalnode ka next jise point krr rha hai uske equal h

  • @palaksolanki8037
    @palaksolanki8037 2 роки тому

    Amazing explanation bhaiya 🥰😄😄😄

  • @tanbirsarkar2640
    @tanbirsarkar2640 Рік тому +1

    bhaiya for creating a new clone linked list there is also using a space of O(n).So, how the last approach is of O(1)

  • @rahulrastogi5312
    @rahulrastogi5312 2 роки тому

    Present bhaiya 🔥🔥❤️

  • @063himanshumishra4
    @063himanshumishra4 2 роки тому

    Bhaiya mauj kr dii

  • @tjstar390
    @tjstar390 2 роки тому

    Thanks bhaiya for giving very handy solution of todays Question

  • @chaudharyaakash7198
    @chaudharyaakash7198 Рік тому +1

    At 45:06,if we are creating Node*next for every originalNode , then isn't space complexity again O(n)?

  • @priyanshukasaudhan786
    @priyanshukasaudhan786 2 роки тому +2

    I am not able to understand how to implement code using classes why not not main () if anyone knows how he implemented plz tell or give the link of video in which he had explained

  • @hrithikrudra4292
    @hrithikrudra4292 2 роки тому

    Awesome bhaiya..
    ✌️✌️

  • @righttoright829
    @righttoright829 2 роки тому

    yo yo yo question me maje aa rhe hai

  • @aashutoshagrawal5239
    @aashutoshagrawal5239 Рік тому

    I watched first video of yours to understand basic concepts of linked list then I open leetcode with linkedlist structured problems then I end up by finishing that with finishing this playlist .. lol 😂 great work .. it took me around 1 month to understand concepts of linkedlist and in this my oops concepts were also brushed up

  • @RohitSingh-hc8yi
    @RohitSingh-hc8yi Рік тому +1

    Thanks a lot Bhaiya

  • @jericodcosta2049
    @jericodcosta2049 2 роки тому

    Attandenc marked consistency op😎

  • @--Blood--Prince--
    @--Blood--Prince-- Рік тому

    51:33
    In line 74 of code wont it throw error if temp-> next =Null?

  • @vinaysharma6646
    @vinaysharma6646 2 роки тому +1

    bhaiya i am having runtime error in the approach iwhere we created the map;

  • @Engineering_Unlocked
    @Engineering_Unlocked 5 місяців тому

    thnx bhaiya :)
    completed on 13/7/24

  • @anuptewary3016
    @anuptewary3016 2 роки тому

    Present bhaiya video dekh kar maja aa rahe haa bhaiya a small suggestion from my side is bhaiya please system designeing v kar wa dena Bhaiya as many company is asking now a days

  • @heybiplabb
    @heybiplabb 2 роки тому

    Present bhaiya ✋

  • @iteself_me
    @iteself_me Рік тому

    225 ✅completed 👍Liked 06:15

  • @9852963775aaa
    @9852963775aaa 2 роки тому

    Thankyou so much bhaiya for this amazing course>>>>>>

  • @AdityaKumar-tz9dr
    @AdityaKumar-tz9dr 8 місяців тому

    bahiya distinct nodes val pe hi ye question banega na? duplicates ke sath to nahi denge na?

  • @bikramghosh845
    @bikramghosh845 2 роки тому

    you are the best bhaiya..

  • @tanujasharma1262
    @tanujasharma1262 Рік тому

    amazing explanation 👏👏

  • @lelebro3876
    @lelebro3876 2 роки тому +3

    Bhaya ab kucch nhi he bas vo bacche dekh rahe he jo serious he pehele jinka khun garam tha ab thanda ho gaya ab jo dekh rahe he vo sab MNC ya Unicorn vale he

  • @ankitpandey4024
    @ankitpandey4024 2 роки тому +1

    I have a doubt that when we declared
    node*=orginalnode ->next;
    then originalNode->next=cloneNode;
    in line 58,59 aproach 3
    how we can have 2 values of next ,why we are able to declare next as a variable

    • @thomasshelby6780
      @thomasshelby6780 Рік тому

      Yes we can assume it as one next is indicating the next pointer while the other is data member of Class created

  • @winnermindset4803
    @winnermindset4803 2 роки тому

    Babbar is love ❤️

  • @sherebanoburhani8939
    @sherebanoburhani8939 2 роки тому

    Present bhaiya❤

  • @naitik554
    @naitik554 2 роки тому

    Bhaiya mast question tha maja aaya....😀😀😀 Lekin bhaiya red colour use mat kro... Not that much visible....