Copy List With Random Pointer (LeetCode 138) | Full Solution with animations and 3 step process

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 23. 07. 2024
  • Join this channel to get access to perks: / @nikoo28
    Actual problem on LeetCode: leetcode.com/problems/copy-li...
    Chapters:
    00:00 - Intro
    00:41 - Problem Statement
    02:44 - What is this special structure?
    04:50 - Brute Force Approach
    07:26 - Step 1 (Create new list with same values)
    10:05 - Step 2 (Copy the random pointers)
    13:53 - Step 3 (Separate the 2 lists)
    18:16 - Dry-run of Code
    20:15 - Final Thoughts
    📚 Links to topics I talk about in the video:
    Linked Lists: ‱ Linked List Data Struc...
    What is Big O?: ‱ Big O Notation Simplif...
    Time Complexity of an algorithm: ‱ What is the Time Compl...
    Other Medium Problems: ‱ Medium Problems
    📘 A text based explanation is available at: studyalgorithms.com
    Code on Github: github.com/nikoo28/java-solut...
    Test-cases on Github: github.com/nikoo28/java-solut...
    📖 Reference Books:
    Starting Learn to Code: amzn.to/3sJm8Wl
    Favorite book to understand algorithms: amzn.to/4848xJH
    Favorite book for data structures: amzn.to/3P96YBv
    Get started for interview preparation: amzn.to/44Nn5du
    🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
    đŸŽ„ My Recording Gear:
    Recording Light: amzn.to/3PdsViT
    Microphone: amzn.to/3Exv83x
    Recording Camera: amzn.to/3PwyN8e
    Tablet to sketch and draw: amzn.to/3ZdKVy7
    Sketching Tool: amzn.to/45XJEgY
    Laptop to edit videos: amzn.to/460ofDu
    đŸ’» Get Social đŸ’»
    Follow on Facebook at: / studyalgos
    Subscribe to RSS feeds: studyalgorithms.com/feed/
    Join fan mail: eepurl.com/g9Dadv
    #leetcode #programming #interview

Komentáƙe • 7

  • @Handlefor
    @Handlefor Pƙed 18 dny

    That was a great explanation. Thank you.

  • @prashanthshetty8337
    @prashanthshetty8337 Pƙed 3 měsĂ­ci +1

    I watched many videos on this problem, you got the best and easy to follow and understand. Thank you so much. I was able to solve this just with your explanation.

    • @nikoo28
      @nikoo28  Pƙed 3 měsĂ­ci +1

      Great to hear!

  • @JANARDHEN
    @JANARDHEN Pƙed 6 dny

    I don't know if you have time to see comments. Thank you for the solution. I have a question. We are creating n extra nodes ( copied node). So, is the space O(n) ? How is it O(1) ? We are modifying by adding more nodes.

  • @rishavsandal4561
    @rishavsandal4561 Pƙed 3 měsĂ­ci +2

    great explanation video i would highly reccomend you to use some dark color background like dark green , dark blue the white board irritating to eyes man. 😘 love your content.

    • @nikoo28
      @nikoo28  Pƙed 3 měsĂ­ci +1

      It is difficult to make diagrams on a dark background. Will keep using white for now

  • @hukum5726
    @hukum5726 Pƙed 2 měsĂ­ci

    Whenever i search questions related to leetcode on CZcams at last i just add nikhil lohia❀