Тёмный

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

Back To Back SWE
Подписаться 241 тыс.
Просмотров 73 тыс.
50% 1

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...

Опубликовано:

 

9 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 367   
@BackToBackSWE
@BackToBackSWE 5 лет назад
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 года назад
where exactly is the code? I can't seem to see it
@BackToBackSWE
@BackToBackSWE 4 года назад
The repository is deprecated - we only maintain backtobackswe.com now.
@rishabkumar4940
@rishabkumar4940 3 года назад
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 года назад
Finally someone who likes to explain stuff and who does it enthusiastically. It's a pleasure to watch! !! Thanks ma dud! :)
@BackToBackSWE
@BackToBackSWE 4 года назад
great and sure
@yanxichen4236
@yanxichen4236 5 лет назад
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 лет назад
haha
@batman_1st
@batman_1st 5 лет назад
Ben's failure helped people like me, so thank you Ben, pls fail more haha!
@paul-mw6pc
@paul-mw6pc 5 лет назад
great stuff, I didn't even understand the question being asked on the leetcode page. Your diagram helped a ton, thank you.
@BackToBackSWE
@BackToBackSWE 5 лет назад
sure
@MiddleEasternInAmerica
@MiddleEasternInAmerica 3 года назад
so far, that's my favorite video on BackToBackSWE channel, I smile everytime he says "again the code in the description" :)
@BackToBackSWE
@BackToBackSWE 3 года назад
haha yeah we transitioned to website
@MultiPriya28
@MultiPriya28 4 года назад
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
@BackToBackSWE
@BackToBackSWE 4 года назад
U a beast
@cryptojeff3993
@cryptojeff3993 4 года назад
This is awesome! Clear explanation. Lost my job offer because of coronavirus and preparing for interviews.
@BackToBackSWE
@BackToBackSWE 4 года назад
Nice, contact us and we can give you a platform membership if you'd like
@lugiadark21
@lugiadark21 3 года назад
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!!
@sanjanachopra2100
@sanjanachopra2100 4 года назад
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
@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!
@vishnuvardhan623
@vishnuvardhan623 5 лет назад
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!
@BackToBackSWE
@BackToBackSWE 5 лет назад
thx
@yvestuyishime5209
@yvestuyishime5209 4 года назад
If i get this question for the first time, i would cry!!!
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@RitikSharma-pc5yj
@RitikSharma-pc5yj 3 года назад
WOW!! Without this problem, the Linked list are incomplete :) Thanks for whatever you taught us
@BackToBackSWE
@BackToBackSWE 3 года назад
sure
@osamaxz5720
@osamaxz5720 Месяц назад
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
@rishabkumar4940
@rishabkumar4940 4 года назад
I was asked this question in an interview today and I got it right just because of you!! Thanks man
@SumitKumar-fn3gj
@SumitKumar-fn3gj 4 года назад
which company bro?
@BackToBackSWE
@BackToBackSWE 4 года назад
great
@BackToBackSWE
@BackToBackSWE 4 года назад
lol chil
@rishabkumar4940
@rishabkumar4940 4 года назад
@@SumitKumar-fn3gj Pensando Systems
@remykhayat5763
@remykhayat5763 5 лет назад
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
@BackToBackSWE
@BackToBackSWE 5 лет назад
sure
@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! =)
@rajatverma1688
@rajatverma1688 4 года назад
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..
@BackToBackSWE
@BackToBackSWE 4 года назад
lol thx
@mvm9888
@mvm9888 5 лет назад
Most detailed and effective teaching video I’ve ever seen on RU-vid, 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.
@dochaar
@dochaar 4 года назад
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 :)
@BackToBackSWE
@BackToBackSWE 4 года назад
got it thanks
@sudhanshuuniyal5737
@sudhanshuuniyal5737 4 года назад
you are INCREADIBLE BEN.
@BackToBackSWE
@BackToBackSWE 4 года назад
nah
@CrazyHunk14
@CrazyHunk14 4 года назад
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.
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@chengjiang7051
@chengjiang7051 5 лет назад
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 лет назад
nice haha, I didn't come up with it either, just learned from someone else
@shruthib3366
@shruthib3366 4 года назад
@@BackToBackSWE Love your modesty here!
@BackToBackSWE
@BackToBackSWE 4 года назад
@@shruthib3366 it's tru
@tonybernoulli7859
@tonybernoulli7859 4 года назад
This is far more clear than any tutorial I watched on youtube, please make more videos like this
@BackToBackSWE
@BackToBackSWE 4 года назад
ok
@ovoboyz1521
@ovoboyz1521 4 года назад
Thanks Ben, you always make complex problems easier to understand! Shoutout from Canada!
@BackToBackSWE
@BackToBackSWE 4 года назад
hey
@kuralamuthankathirvelan
@kuralamuthankathirvelan 5 лет назад
Perfect explanation bro ! Keep posting more videos !
@BackToBackSWE
@BackToBackSWE 5 лет назад
ok, on it
@kaustubhdwivedi1729
@kaustubhdwivedi1729 3 года назад
Can't get a better explanation 🤯
@waxylayer8353
@waxylayer8353 4 года назад
Second approach is just great 💥 u r a genius !
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks!
@wishfulthinker6139
@wishfulthinker6139 4 года назад
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.
@BackToBackSWE
@BackToBackSWE 4 года назад
great and welcome
@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!
@Rendbot
@Rendbot 5 лет назад
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 лет назад
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.
@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 !
@duranraprez
@duranraprez 4 года назад
This blew my mind lol
@BackToBackSWE
@BackToBackSWE 4 года назад
nice
@meenameiss
@meenameiss 5 лет назад
You're great at teaching, congratz. Keep going as long as you can
@BackToBackSWE
@BackToBackSWE 5 лет назад
thx
@r1jsheth
@r1jsheth 5 лет назад
BIG thumbs up!! Loved the way you teach!
@BackToBackSWE
@BackToBackSWE 5 лет назад
thank you
@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 .
@cristianouzumaki2455
@cristianouzumaki2455 2 года назад
Just came back the fourth time. Argh!!!!!!!!!!!!!
@mrivesingh
@mrivesingh 4 года назад
You just made this really simple to understand! Thanks a ton!
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@manvityagi6529
@manvityagi6529 4 года назад
I wish! You did not deprecate the existing repository at least, even if you shifted things to backtobackswe.com. It was really helpful. :(
@BackToBackSWE
@BackToBackSWE 4 года назад
yes
@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 👌
@gulshansingh3933
@gulshansingh3933 4 года назад
Awesome stuff dude
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@ogetysaivamsi106
@ogetysaivamsi106 4 года назад
Thank you for making it very simple to understand.
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@SuprBrian64
@SuprBrian64 3 года назад
Great Explanation!
@canaDavid1
@canaDavid1 4 года назад
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.
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@veeralsharma6748
@veeralsharma6748 4 года назад
best explanation for this question out there
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks
@ankurgupta4696
@ankurgupta4696 4 года назад
Your are One of the best teachers on youtube , i learn so much from you
@BackToBackSWE
@BackToBackSWE 4 года назад
I am but a man
@cesaredecal2230
@cesaredecal2230 4 года назад
Finally understood this. Thank you!
@BackToBackSWE
@BackToBackSWE 4 года назад
NO. FREAKING. WAY. WHAT. Wassup Cesare hahahahahaha
@cesaredecal2230
@cesaredecal2230 4 года назад
@@BackToBackSWE Haha back to the interview game and you come to my rescue
@BackToBackSWE
@BackToBackSWE 4 года назад
@@cesaredecal2230 lmao, good luck
@sophiehall38
@sophiehall38 5 лет назад
Can't believe that I have watched this video and I still can't remember how to solve this problem.
@BackToBackSWE
@BackToBackSWE 5 лет назад
haha
@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.
@MithleshKumar-iz1dz
@MithleshKumar-iz1dz 5 лет назад
Great, great, great!
@BackToBackSWE
@BackToBackSWE 5 лет назад
thanks
@svdfxd
@svdfxd 5 лет назад
Awesome explanation and beautiful way of rewiring nodes in the LinkedLists.
@BackToBackSWE
@BackToBackSWE 5 лет назад
indeed
@mohinim.1654
@mohinim.1654 4 года назад
Awesome video! It would be really helpful, if you could put code in either description or github.
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks and the repository is deprecated - we only maintian backtobackswe.com's solutions.
@a.yashwanth
@a.yashwanth 4 года назад
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 года назад
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
@prithazz
@prithazz 4 года назад
You are an amazing teacher!
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@tapasu7514
@tapasu7514 5 лет назад
Best Explanation Ever ! Thanks for all the great videos
@BackToBackSWE
@BackToBackSWE 5 лет назад
sure
@ashwiniabhishek1504
@ashwiniabhishek1504 4 года назад
Great video thanks
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@pushpendrasingh1819
@pushpendrasingh1819 5 лет назад
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
@BackToBackSWE
@BackToBackSWE 5 лет назад
Yeah sure haha
@vivekgr3001
@vivekgr3001 4 года назад
good explanation
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@abhishekkumarjaiswal1507
@abhishekkumarjaiswal1507 3 года назад
great explanation sir
@scodz2007
@scodz2007 4 года назад
You ROCK bro, keep up the good work!
@BackToBackSWE
@BackToBackSWE 4 года назад
u rock
@tewodroswolde9830
@tewodroswolde9830 4 года назад
Thanks for posting Ben! Arif sira newu. Berta!
@BackToBackSWE
@BackToBackSWE 4 года назад
Thanks
@mahadreamz
@mahadreamz 3 года назад
Great stuff. You said code is in the description. Where is it?
@shravyaramesh6040
@shravyaramesh6040 5 лет назад
This is beautiful and you are amazing.
@BackToBackSWE
@BackToBackSWE 5 лет назад
ur cool
@shivanshrawat2688
@shivanshrawat2688 4 года назад
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?
@mohitbhatia1994h
@mohitbhatia1994h 5 лет назад
Great and elegant explanation.
@BackToBackSWE
@BackToBackSWE 5 лет назад
thanks
@alexanderchao5389
@alexanderchao5389 3 года назад
This is such a beautiful explanation!
@fannnatic
@fannnatic 4 года назад
awesome. thank you
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@gamberril
@gamberril 4 года назад
Very good explanation, thanks !
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@Max-zf5ot
@Max-zf5ot 5 лет назад
You are an amazing teacher !!!!
@BackToBackSWE
@BackToBackSWE 5 лет назад
thanks
@subhangijena4381
@subhangijena4381 4 года назад
Best explanation of this question.
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@gurleenkaur5786
@gurleenkaur5786 5 лет назад
Really great explanation and thanks for providing the code!!
@BackToBackSWE
@BackToBackSWE 5 лет назад
sure
@goodwish1543
@goodwish1543 4 года назад
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 года назад
It only took me first couple minutes to understand each solution, very good teaching.
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@AbhishekSingh-fc6tb
@AbhishekSingh-fc6tb 4 года назад
Brilliant way!
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@xinyuyou7512
@xinyuyou7512 5 лет назад
Really great explication. Thank you!
@BackToBackSWE
@BackToBackSWE 5 лет назад
sure
@shwetasharma-hz3ib
@shwetasharma-hz3ib 3 года назад
thank you, you made it look so easyyyyyyy......
@BackToBackSWE
@BackToBackSWE 3 года назад
ye
@xiuwenzhong7375
@xiuwenzhong7375 5 лет назад
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 лет назад
yeah, I couldn't have gotten it
@SarabjotSingh294
@SarabjotSingh294 3 года назад
Really amazing explanation!!!! Thanks!
@kunqian06
@kunqian06 4 года назад
Just awesome as usual. Bravo!
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@AmeyaKherodkar
@AmeyaKherodkar 4 года назад
Very Nice Explaination (Y) and the efforts you take to make yours viewer understand (Y)
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@FirefoxGuy18
@FirefoxGuy18 3 года назад
Thank you
@sukritkapil2562
@sukritkapil2562 4 года назад
Just Wow! Thanks a lot!!
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@Alex-wy2ko
@Alex-wy2ko 4 года назад
great video! lots of thanks!
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@davidj2597
@davidj2597 4 года назад
Thanks man, you are so helpful
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@mmfawzy4850
@mmfawzy4850 4 года назад
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
@priyankareddy7408
@priyankareddy7408 2 года назад
Love it! Thank you
@BackToBackSWE
@BackToBackSWE 2 года назад
Thank You!! Do check out backtobackswe.com/platform/content and please recommend us to your family and friends :)
@Metachief_X
@Metachief_X 4 года назад
Great stuff dude!!!!
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@kharinskiyalexey7409
@kharinskiyalexey7409 5 лет назад
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 лет назад
i agree, depends on what matters more to you/the interviewer
@alperozdamar517
@alperozdamar517 4 года назад
Amazing solution. I liked it. Very easy to understand and implement. Thank you. :)
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@priyankmungra29
@priyankmungra29 3 года назад
great detailed explanation. Thank you sir for your efforts.❤❤❤
@savar33
@savar33 4 года назад
You are the man!
@BackToBackSWE
@BackToBackSWE 4 года назад
no u
@uyennguyen-tw6kp
@uyennguyen-tw6kp 5 лет назад
thanks for your videos!!
@BackToBackSWE
@BackToBackSWE 5 лет назад
sure
@mayurkoli4145
@mayurkoli4145 4 года назад
Just Want to huge you my friend. #StayHome
@BackToBackSWE
@BackToBackSWE 4 года назад
hello
@ankugupta413
@ankugupta413 5 лет назад
This was so cool! Thanks
@BackToBackSWE
@BackToBackSWE 5 лет назад
thanks
@steelcube
@steelcube 5 лет назад
Thanks for this!
@BackToBackSWE
@BackToBackSWE 5 лет назад
yeah sure
@DonTaldo
@DonTaldo 3 года назад
Awesome contentt
@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.
@GlassLooking
@GlassLooking 4 года назад
F-man, brilliant sir! I was asked something similar of constant space using a Tree at Google... They are really asking impossible questions now for interviews at Google.. And absolutely Yes, at google they would ask this O(1) space question.. they did to me.. "They called to reject me in person after 3rd interview, to let me know my answers weren't "Google" enough" :( Oh well keep on studying.. but this definitely helps! Thnx
@BackToBackSWE
@BackToBackSWE 4 года назад
yes
@shyamraju4668
@shyamraju4668 3 года назад
Awesome...
@BackToBackSWE
@BackToBackSWE 3 года назад
thx
@snehalahire1194
@snehalahire1194 4 года назад
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.
@alitherland765
@alitherland765 3 года назад
Where do I find the code? I cannot find it.
Далее
ДОКАЗАЛ ЧТО НЕ КАБЛУК #shorts
00:30
Просмотров 998 тыс.
Bike vs Super Bike Fast Challenge
00:30
Просмотров 13 млн
Naming Things in Code
7:25
Просмотров 2,1 млн