MENU

Fun & Interesting

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

Nikhil Lohia 6,622 11 months ago
Video Not Working? Fix It Now

Join this channel to get access to perks: https://www.youtube.com/channel/UCT-S2ngqEBoYCM5UKuNeELg/join Actual problem on LeetCode: https://leetcode.com/problems/copy-list-with-random-pointer/ 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: https://youtu.be/lrXpTVEAXCM What is Big O?: https://youtu.be/-MJ7EIV57dI Time Complexity of an algorithm: https://youtu.be/hYnsWroM4kQ Other Medium Problems: https://www.youtube.com/playlist?list=PLFdAYMIVJQHO1paovM-tu2vtGzQU72z_U 📘 A text based explanation is available at: https://studyalgorithms.com Code on Github: https://github.com/nikoo28/java-solutions/blob/master/src/main/java/leetcode/medium/CopyListWithRandomPointer.java Test-cases on Github: https://github.com/nikoo28/java-solutions/blob/master/src/test/java/leetcode/medium/CopyListWithRandomPointerTest.java 📖 Reference Books: Starting Learn to Code: https://amzn.to/3sJm8Wl Favorite book to understand algorithms: https://amzn.to/4848xJH Favorite book for data structures: https://amzn.to/3P96YBv Get started for interview preparation: https://amzn.to/44Nn5du 🔗 To see more videos like this, you can show your support on: https://www.buymeacoffee.com/studyalgorithms 🎥 My Recording Gear: Recording Light: https://amzn.to/3PdsViT Microphone: https://amzn.to/3Exv83x Recording Camera: https://amzn.to/3PwyN8e Tablet to sketch and draw: https://amzn.to/3ZdKVy7 Sketching Tool: https://amzn.to/45XJEgY Laptop to edit videos: https://amzn.to/460ofDu 💻 Get Social 💻 Follow on Facebook at: https://www.facebook.com/studyalgos Subscribe to RSS feeds: https://studyalgorithms.com/feed/ Join fan mail: http://eepurl.com/g9Dadv #leetcode #programming #interview

Comment