Тёмный

Odd Even Linked List (LeetCode 328) | Full solution with diagrams | Study Algorithms 

Nikhil Lohia
Подписаться 42 тыс.
Просмотров 11 тыс.
50% 1

A linked list is a really helpful data structure as it does not have any indices, and thus allows you to insert and delete at any position. However, this also causes problems when you have to perform operations that involve indexes. One must really take advantage of the non-linear property of this data structure. Watch the video to understand how you can group odd and even indices without taking any extra space.
Actual Problem: leetcode.com/problems/odd-eve...
Chapters:
00:00 - Intro
01:01 - Problem Statement
03:11 - The most obvious solution
05:16 - Efficient Solution
11:48 - Dry-run of Code
14:32 - Final Thoughts
📚 Links to topics I talk about in the video:
Linked Lists: • Linked List Data Struc...
Traversing Linked Lists: • Traversing a Linked Li...
📘 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/36pU0JO
Favorite book to understand algorithms: amzn.to/39w3YLS
Favorite book for data structures: amzn.to/3oAVBTk
Get started for interview preparation: amzn.to/39ysbkJ
🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
🎥 My Recording Gear:
Recording Light: amzn.to/3pAqh8O
Microphone: amzn.to/2MCX7qU
Recording Camera: amzn.to/3alg9Ky
Tablet to sketch and draw: amzn.to/3pM6Bi4
Surface Pen: amzn.to/3pv6tTs
Laptop to edit videos: amzn.to/2LYpMqn
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Follow on Twitter at: / studyalgorithms
Follow on Tumblr at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #linkedlist #interview

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

 

25 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 60   
@6lack-Echo
@6lack-Echo Год назад
please dont ever stop making videos, you have the best explanations !
@nikoo28
@nikoo28 Год назад
If only I get a few more subscribers 😅
@pranithreddy
@pranithreddy 7 месяцев назад
I am new one please dont stop@@nikoo28
@ranjeetapathak8565
@ranjeetapathak8565 Год назад
i wish all of the leetcode problem' s solutions explained by you.Than you for the explanation!! :))
@funnymoment9164
@funnymoment9164 10 месяцев назад
Thanks! Cool explanation.
@likhansarkar1200
@likhansarkar1200 Год назад
thanks for this, i see everyone creating new lists, thats using extra space!!
@user-ty1sd8xh7o
@user-ty1sd8xh7o 5 месяцев назад
Honestly the best explanation out here, please continue your great work.
@alexgu3257
@alexgu3257 Месяц назад
Really clear explanation, thanks!
@swethak3505
@swethak3505 2 месяца назад
Thanks for the explanation
@Shadowxgaming_
@Shadowxgaming_ 6 месяцев назад
best explanantion bhaiya , thanks you so much
@sanjammanagi6562
@sanjammanagi6562 11 месяцев назад
great explanation sir
@LogicTherapy
@LogicTherapy 27 дней назад
that was really well done
@studentchampion718
@studentchampion718 13 дней назад
Nice Explanation
@sobitregmi31
@sobitregmi31 Год назад
Great explanation bro
@shivacoding
@shivacoding 2 месяца назад
Please do all leetcode problem videos, you are one and only the best.
@kunalkheeva
@kunalkheeva Год назад
Great!
@shivacoding
@shivacoding 2 месяца назад
You deserve 1 million Subscribers.❣
@ankit_yr_senpai
@ankit_yr_senpai 2 дня назад
best explanation sir
@himanshuvaishya9164
@himanshuvaishya9164 10 месяцев назад
I have seen many videos for this problem but your teaching method is best and easy to visualise
@nikoo28
@nikoo28 9 месяцев назад
i like visual solutions
@devu5501
@devu5501 3 месяца назад
You have the great explanation really ❤
@nikoo28
@nikoo28 3 месяца назад
Thank you! 😃
@jaysingh-rn6ge
@jaysingh-rn6ge 6 месяцев назад
Thank you
@smandal1237
@smandal1237 2 месяца назад
thank you so much..plzz dont"t stop
@nikoo28
@nikoo28 2 месяца назад
I will try my best
@TheSachinAlam
@TheSachinAlam 11 месяцев назад
Best explanation ever!!!
@nikoo28
@nikoo28 10 месяцев назад
Glad you think so!
@samridhshubham8109
@samridhshubham8109 5 месяцев назад
Perfect Approach Perfect Explanation Perfect Drawing to understand better
@nikoo28
@nikoo28 4 месяца назад
simply lovely
@subee128
@subee128 6 месяцев назад
Thanks
@satestactmathtutor6570
@satestactmathtutor6570 10 месяцев назад
best explanation on youtube how you donot have 100 k views ,, it will come broo do not worry just keep going and do not stop making videos plzzzz
@nikoo28
@nikoo28 9 месяцев назад
please share as much as possible :)
@WebMaster600
@WebMaster600 7 месяцев назад
Cool bro 😎
@AbhinavKumar-dl2ph
@AbhinavKumar-dl2ph Месяц назад
Why we do not have condition for odd in while loop ? while(odd!=null) ?
@rishavranjan6656
@rishavranjan6656 9 месяцев назад
Your explanation is always the BEST and one more thing to ask are you a Tifosi (Ferrari Fan) and specially Seb fan ?
@nikoo28
@nikoo28 9 месяцев назад
Sharp observation I must say.. 😄 Yes..a Ferrari fan..but that isn’t working out lately 😂
@rishavranjan6656
@rishavranjan6656 9 месяцев назад
@@nikoo28 yeah Ferrari strategies are so brute force they don't think of optimised strategies 😂
@syedtaqi54
@syedtaqi54 Год назад
Hello Nikhil can u please make video on "Flatten a Linked List"
@nikoo28
@nikoo28 Год назад
Can you describe the problem statement?
@nikoo28
@nikoo28 Год назад
Or a link to the problem…where can I find it!
@meghasingh9170
@meghasingh9170 16 дней назад
Why is the while loop condition : "while even and even.next" and not "while odd and odd.next"?
@kidoo1567
@kidoo1567 8 месяцев назад
Nikil...can u do sums for stack and queue?
@nikoo28
@nikoo28 8 месяцев назад
do you have specific problems in mind?
@user-nf5vg9pu5r
@user-nf5vg9pu5r 4 месяца назад
The code not working for odd length linked list
@tyy899
@tyy899 6 дней назад
why this is not getting worked while(even.next!=null&&odd.next!=null) { this loop condition bro can you help me out .. :)
@jayprakashjaiswaldeptofcom1250
Bhaiya please thora frequent video upload karo
@nikoo28
@nikoo28 Год назад
i keep trying...but it takes me almost 10 hours to produce 1 video from scratch. Thinking about a problem, simplifying it as much as I can, creating all those images and diagrams, recording, editing, publishing with all the links, creating thumbnails. It is a very lengthy process along with my day job and a married life. Thanks for all your support and patience, I try to be as consistent as possible and want to focus on quality over quantity. Hope I retain you as my viewer. :)
@kulkarnisoham
@kulkarnisoham Год назад
@@nikoo28 😱😱 10 hours! really? hats off.. So this is the reason behind lucid explanation and the clean slides. Best of luck brother
@plutomessi21
@plutomessi21 10 месяцев назад
thank you bhaiya
@viking8774
@viking8774 3 месяца назад
Sir can you explain. Split the linked list in 2 halves where one list contains only odd values and other contains only even values
@nikoo28
@nikoo28 3 месяца назад
What do you mean?
@viking8774
@viking8774 3 месяца назад
@@nikoo28 I mean to say One half contains odd data and other half contains even data
@pcccmn
@pcccmn Год назад
I think you are so much better at teaching than NeetCode and TechDose =)
@wenkaiyang1487
@wenkaiyang1487 7 месяцев назад
why don't you set odd = odd.next.next instead of odd.next = odd.next.next; and odd = odd.next?
@wickedgabrugamer
@wickedgabrugamer 6 месяцев назад
this will not alter the pointers, it will just move the odd pointer to next.next. so 1st alter and then move.
@Rahulkumar-vn1vm
@Rahulkumar-vn1vm 4 месяца назад
why we cant use while odd!=Null and odd!=Null instead of even????
@nikoo28
@nikoo28 4 месяца назад
please clarify
@subhamagarwal476
@subhamagarwal476 Месяц назад
Because if you carefully see. Even will reach the null very soon as compared to odd because it is starting one after odd. So if we save even check somehow then we will definitely save odd thats for sure . So we are putting condition like while (even != null)
@likhithakande2902
@likhithakande2902 Год назад
😛😛😛
@likhithakande2902
@likhithakande2902 Год назад
😝😝😝
Далее
МОЙ НОВЫЙ ДОМ
1:01:04
Просмотров 1,8 млн
CLANCY 🦞 Operation Squid Ink (New Animation)
00:58
L6. Odd Even Linked List | Multiple Approaches
24:05
Просмотров 67 тыс.