Тёмный

Design Linked List - Leetcode 707 - Python 

NeetCodeIO
Подписаться 145 тыс.
Просмотров 22 тыс.
50% 1

🚀 neetcode.io/ - A better way to prepare for Coding Interviews
🥷 Discord: / discord
🐦 Twitter: / neetcode1
🐮 Support the channel: / neetcode
⭐ BLIND-75 PLAYLIST: • Two Sum - Leetcode 1 -...
💡 DYNAMIC PROGRAMMING PLAYLIST: • House Robber - Leetco...
Problem Link: leetcode.com/problems/design-...
0:00 - Read the problem
0:30 - Drawing Explanation
3:35 - Coding Explanation
leetcode 707
#neetcode #leetcode #python

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

 

7 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@Javokh1r
@Javokh1r 3 месяца назад
Creating extra dummy nodes is well-thought and makes the double linked list so easy to implement. Thanks a lot!
@voctor1381
@voctor1381 Год назад
Commenting as a surprise for myself in a few months during Leetcode season Happy Neetcoding everyone 👍
@amlivinginhell
@amlivinginhell 9 месяцев назад
what happened?
@vijayvarshinilakshminaraya887
@vijayvarshinilakshminaraya887 3 месяца назад
The jump from ‘you can turn off your brain’ to ‘maybe you don’t have to turn off your brain too much’ had me😂😂😂😂😂😂😂
@krateskim4169
@krateskim4169 Год назад
your consistency is awesome
@maryabuor2824
@maryabuor2824 Год назад
This is very well explained, especially the illustrations. You've gained a new subscriber!
@lembueno894
@lembueno894 8 месяцев назад
Nothing makes me more sad than after 2 hours of this trying to fix the 36th case, I give up and look this video up for a WAY more simpler and short solution. The count down loops would have helped :/
@kartikgadagalli1008
@kartikgadagalli1008 2 месяца назад
The doubly linked list is easy to implement it's the edge cases where a lot of errors happen. The dummy nodes really make it easy to implement a doubly linked list.
@Ziad.Dev99
@Ziad.Dev99 11 месяцев назад
Thanks a lot 👍 I think the main idea here is 'two dummy nodes', this makes me control the boundaries of linked list. this technique helps in many linked list problems.
@podilichaitanyaakhilkumar4911
Explained well 👏👏. I am a regular follower of your channel. I have gone through your playlist, but I could only find a few hard problems and many easy and medium problems. Upload more leetcode hard problems. It will be beneficial for cracking Faang companies. Thank you.
@NikhilAsawadekar
@NikhilAsawadekar 15 дней назад
at 7:33, can we just assume that index is always going to be 0 if cur is not null and cur is not self.right? What't the need to check index == 0 in the while loop?
@business_central
@business_central Год назад
Can anyone please tell me why in his last function: DeleteAtIndex only checked if curr != Self.right ? What about if the pointer is put on the left dummy node self.left ??
@staceyonuora5329
@staceyonuora5329 Год назад
The pointer would never be on the self.left dummy node. This is because he started the current node from self.left.next and moved further right from there on.
@pavanbandaru8180
@pavanbandaru8180 6 месяцев назад
He doesnt want to delete the dummy node
@Disusede
@Disusede Год назад
At the moment of writing this, this solution fails on Leetcode. For it to pass correctly you have to set a right boundary to the while loop list traversal by adding a `node != self.right` condition. Otherwise if you go out of bounds the code will try to access a .next property on a None value and will fail.
@Disusede
@Disusede Год назад
So for example the while loop condition in the get method will be: while cur and index > 0 and cur != self.right:
@AmitDeveloper-mg3kl
@AmitDeveloper-mg3kl 9 месяцев назад
For me all the TC passed . I did not change the code but it works fine@@Disusede
@MrCCronyn
@MrCCronyn 6 месяцев назад
This solution gives me a memory limit exceeded error. Does anyone know why?
@iftekharuddin
@iftekharuddin Год назад
💪
@raz_dva_
@raz_dva_ Год назад
There is no Memory Leak issue here - both Java and Python will immediately collect node to garbadge as far as it is not referenced from main program grapth.
@william.darrigo
@william.darrigo Год назад
cries in binary
@KevinDevZ
@KevinDevZ Год назад
Im early
@pabloj1336
@pabloj1336 29 дней назад
Anyone else get AttributeError: 'NoneType' object has no attribute 'next' ^^^^^^^^^ prev.next = newNode Line 59 in addAtIndex (Solution.py) ^^^^^^^^^^^^^^^ result = obj.addAtIndex( Line 117 in __helper_select_method__ (Solution.py) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ret.append(__DriverSolution__().__helper_select_method__(method, params[index], obj)) Line 163 in _driver (Solution.py) _driver() Line 172 in (Solution.py) with this solution?
Далее
Map and HashMap in Java - Full Tutorial
10:10
Просмотров 545 тыс.
Впервые дал другу машину…
00:57
Design a Singly Linked List
12:12
Просмотров 14 тыс.
Design Twitter - Leetcode 355 - Python
22:47
Просмотров 75 тыс.
The Unfair Way I Got Good At LeetCode
23:02
Просмотров 60 тыс.
Learn Linked Lists in 13 minutes 🔗
13:24
Просмотров 264 тыс.
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
How I would learn Leetcode if I could start over
18:03
Просмотров 306 тыс.
Unique Paths II - Leetcode 63 - Python
14:31
Просмотров 13 тыс.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36