When you drew it in the end with the steps it just snapped in my brains and I ynderstood everything xd
@josephogoley3 жыл бұрын
Same!
@LongLe-ri5hs3 жыл бұрын
Me too
@curtism73024 жыл бұрын
Watched the whiteboard explanation 2 times , went back and looked at what next_node was equal to (i forgot) watched the whiteboard explanation a 3rd time and understood it! Watched it a 4th time and realized he was making perfect sense in his explanation. Nick, Just found your videos today through Kevin Naughton (who I also found today) Thanks for making these videos.
@Bad1tude2 жыл бұрын
so basically you were in recursion
@vijayaprabhakaranr54782 жыл бұрын
@@Bad1tude he was iterative for the number of mistakes in the code.
@GagandeepSingh-lz5bg3 жыл бұрын
Your explanation is much easier to understand than the other youtube videos I have watched on this topic. Thank you.
@soumyadeepmitra8114 жыл бұрын
Had to watch it a couple of times to understand but at the end it was crystal clear. Thanks Nick !!!
@toastyshrimp18822 жыл бұрын
A good way to think about this, is you're flipping the pointers. Instead of each node pointing to their next node, you flip them to point to the node before, instead of 1 pointing to 2, 2 points to 1. You start this chain by first setting a new "head" node, to be a new node that comes before the head node.
@icemotion19253 жыл бұрын
I was struggling for hours before watching this video, thank you very much! Your drawing at the end triggered my Eureka effect.
@AliMalik-yt5ex2 жыл бұрын
By far the best explanation I have seen, the whiteboard visual is what helped! This is fantastic, Nick!
@merxgrc99402 жыл бұрын
i like the fast pace and simple explanations for complicated topics really works for my adhd brain :)
@aaaminahammm43652 жыл бұрын
Thank you so much nick, couldn't understand at first then i went back watched again did some copy work and got it
@nipunsandamal9882 Жыл бұрын
This is the greatest explanation that I've found about reverse linked list
@ahmedaj20003 жыл бұрын
thanks for the visual on the whiteboard!
@letsplay96673 жыл бұрын
Please use white board for better understanding of solutions. It's really helpful.
@jacobl74513 жыл бұрын
this question is so famous, it's basically a meme
@coolengineering34862 жыл бұрын
your way to explain makes sense in a way I can really understand. Thank you!!!!!
@pixel70385 жыл бұрын
Techlead would be proud of you.
@TheKhalid14 жыл бұрын
Whoop. This didn't age well
@markpascual1004 жыл бұрын
@@TheKhalid1 what happened
@datboi_gee7 ай бұрын
lmao 5:16, the classic "you know what I'm sayin'?" Yes, I do believe I know what you're sayin'.
@alexirabor3 жыл бұрын
You are such a blessing. You saved me hours of confusion.
@colinrickels201 Жыл бұрын
Fav parts when you said, 'know what f this, lets do the whiteboard'. It is not easy to explain this one without visual representation. Its one those problems that an SWE with any experience has to revisit cause it will always be confusing.
@MrRobeezy292 жыл бұрын
Super clear when you see it drawn. Thank you 🙏
@lifeofme31724 жыл бұрын
Thank you for the beautiful efficient solution I had to watch the video couple of times to understand 😂
@kelvincheung72724 жыл бұрын
always like your explanation, very clear and easy to understand
@daveB1332 жыл бұрын
Thanks Nic. You've really helped me to understand this problem. One thing than confused me slightly was at 5 mins, you've got null > 1. I don't believe this link exists?
@tonyhiga88772 жыл бұрын
literally i'm watching this video ten times, kudos to your efforts.
@Kyle-ho4lj4 жыл бұрын
Nick I would pay handsomely for more white board vids like tihs. you're a genius
@brie88613 жыл бұрын
Breehhhh!!! Thank you so much I was staring at this for forever trying to figure it . Seems so easy the way you explain
@ms03726314 жыл бұрын
My only question is: null was never assigned pointed to head, how come you drew that on the board?
@raaghavaadithya3 жыл бұрын
that arrow wasn't necessary, prob just a mistake!
@nigelgore59972 жыл бұрын
3:21 It was at that moment i realized you are the Guru. 😁
@jugsma66764 жыл бұрын
Finally Nick White on White Board
@sowmyasg81274 жыл бұрын
thanks a lott for the explanation.. i understood very easy
@atuljain55393 жыл бұрын
thanks for good explanation .
@mdouet3 жыл бұрын
If this more or less efficient than solving it with recursion?
@nirmalbhimani90332 жыл бұрын
Last explanation was amazing
@timurdosmurzayev62203 жыл бұрын
Thank you, man! You did an awesome explanation
@AjaySingh-xd4nz4 жыл бұрын
A "beautiful mind"
@sejinmajnaric28844 жыл бұрын
Such a great explanation! Thanks a lot!
@georgetiganila66673 жыл бұрын
Great demo on the whiteboard!
@griffinhealy2004 жыл бұрын
Thank you for the explanation!
@samm55713 жыл бұрын
I’m addicted to reversing linked lists
@dannyslebs63212 жыл бұрын
Thank you dude so clear!!
@nihardabhi56222 жыл бұрын
can we use stack and pop out from the end and each of these the connected with simple link ???
@OTT_Assassin2 жыл бұрын
On the white board does prev change to two the first time?
@lookintomyeyes26814 жыл бұрын
just to add to the solution : you need to add start= pre after the end of all the loops
@ach9523 жыл бұрын
3:36 auto typing features omg 😄
@bruteforce24342 жыл бұрын
Simple and efficient, thanks.
@prasadm36143 жыл бұрын
Do we really need head.next=prev assignment ..... I don't understand why. I think it works without
@blackraven60494 жыл бұрын
Are you a UB student or alumnus?
@salomeoumarouwate2024 Жыл бұрын
Nick is just the GOAT!!!!
@aribbhai3343 Жыл бұрын
damn bro I was gonna quit everything till I saw this video. Now I know how to reverse a linked list. I'm comin for u Google
@rohitparthasarathy66713 жыл бұрын
Easy explanation - Thanks.
@rabihutomo15982 жыл бұрын
pls do more algo & data structure
@jamm98483 жыл бұрын
Thank you it helped me 🙏
@Levelord92 Жыл бұрын
I'm trying to understand this thing 2 days in a row, still my mind can't handle this.
@mannana85503 жыл бұрын
'So do you wanna be a software engineer at google?' -- No, thank you Clement's girlfriend! Leave me alone
@zerlinazeng40642 жыл бұрын
you are such a genius!!
@tej36793 жыл бұрын
Awesome explanation
@sagunpandit63143 жыл бұрын
recursively?
@crackcodinginterview49954 жыл бұрын
That’s a good one Nick!
@jkewara763 жыл бұрын
great thank you from India
@arjay_20022 жыл бұрын
O(n) right?
@jaxconf95193 жыл бұрын
OMG THANKYOU!! best video ever!!
@huythe31702 жыл бұрын
Thanks
@abhirammadhu29733 жыл бұрын
Can someone explain what happens on line 13, instead of ListNode prev = null; we write ListNode prev = new ListNode(); I did this on leetcode and I got an extra zero at the end of the output. How did this happen. What is the exact difference between the two??
@iuseyoutubealot2 жыл бұрын
this is a good question, do you know the answer to this now by any chance?, im curious
@shivam_sharma704 Жыл бұрын
thank you
@sameer93683 жыл бұрын
Please make more such video
@sanyamkothari44692 жыл бұрын
4:40 start from here and understand in 15 sec
@ForNoOne14 жыл бұрын
Runtime 0ms?? What hacks are you using
@samuelmartinelli77302 жыл бұрын
If she doesn’t know how to reverse a linked list, I don’t want her.
@arpit82734 жыл бұрын
why do we return prev?
@timothyclifford72884 жыл бұрын
prev ends up being the head because the while-loop runs until you shift the head to the last next value, which is Null
@justins77964 жыл бұрын
the main code is a function definition that needs to return a ListNode object ( at line 11)
@justins77964 жыл бұрын
could've returned any data type desired, for example public ListNode could have been a float or void if he'd wanted, but in this case it was most practical to return an object that is a linked list
@yudhisthirsingh84014 жыл бұрын
Runtime 0ms, How is that possible? The parameters shown by leetcode looks like a prop to me sometimes.
@mdouet3 жыл бұрын
It ran in under 1,000,000 nanoseconds.
@leaoverend78604 жыл бұрын
when creating new ListNodes, when would you use the new keyword?
@nirmalbisht82973 жыл бұрын
nope
@mdouet3 жыл бұрын
No we just want a reference/pointer to the nodes, not a new instantiation of a node.
@daljeetsingh97364 жыл бұрын
Hi ! Can you please explain to me how did you return prev; in the return statement? I would be highly grateful.
@yudhisthirsingh84014 жыл бұрын
When the looping is done, prev points to null which is the start of the linked list (After modification).
@pt49092 жыл бұрын
You are a hero
@yuvrajbansal62944 жыл бұрын
Great job
@topG4483 жыл бұрын
Fellow Alumni... Go Bulls!
@sarscov98543 жыл бұрын
How the fuck can anyone pass those coding interviews without memorizing how to solve hundreds of problems?
@ChickenMaster72 жыл бұрын
That link list things are confusing af lol
@Salesforce_Nexus4 жыл бұрын
good one!
@adityarajmane6953 жыл бұрын
low audio
@vlinkin222 жыл бұрын
Gold !
@GameFlife Жыл бұрын
Hi Nick
@adityasinghrajawat73444 жыл бұрын
You are just amazing.
@enderezjaroldadrian68653 жыл бұрын
I love you Nick
@Montclairsoccer14 жыл бұрын
What a guy!
@udaychatterjee44243 жыл бұрын
Dude no wonder you have more subscribers now. You used to explain way more than it’s needed. Lol
@xvzf1153 жыл бұрын
ok Mr. Expert
@KyuriousBot2 жыл бұрын
When you see it (:
@34adnanali262 жыл бұрын
wow
@Truthhurtsbad3 жыл бұрын
go bulls
@knajdovski3 жыл бұрын
Thanks for the clear explanation. P.S. you should go to bed
@devke1252 жыл бұрын
AWESOME 🖤🔥🖤🔥🖤
@tsaileslie8958 Жыл бұрын
You are really handsome and please make more videos😂❤
@Supersoaker-xy2cr2 жыл бұрын
wooooooow i finally get it lmao
@tjray34034 ай бұрын
W guy
@MaminaZvezdochka3 жыл бұрын
@georgetsiklauri4 жыл бұрын
Man, if you ever want to become teacher/trainer, please never explain concept like this. Your solution works, but the explanation should be for others, not that you understand what you talk.
@yudhisthirsingh84014 жыл бұрын
I think it was well explained
@HanifCarroll4 жыл бұрын
Which part did you think could have been better explained? Or how do you think he could improve? If you would actually like him to improve his technique as a teacher, then he's going to have a hard time doing that when he doesn't know what exactly is wrong.
@ASMSADIQULISLAM4 жыл бұрын
His explanation is clear. It's not necessary that we always explain first and code later.