Design a Singly Linked List

preview_player
Показать описание


#neetcode #algorithms #python
Рекомендации по теме
Комментарии
Автор

Setting the head to an empty value really makes a huge difference

HermesSoilder
Автор

I dont understand part 6:28. If we want to insert a new head. Shouldnt new_node.next = self.head, and self.head = new_node . So we first point the new head to the old head node, then we assign it as the new head. But now you are inserting a node between the old head and the old heads next node ... ?

alexzan
Автор

Well I hope my data structure college course would be helpful xD. But we did it using struct in c++ and not class but I guess the same idea could be applied here.

grandparick
Автор

How did you make a leetcode-like editor on your website? What libraries/tools did you use?

anonymoussloth
Автор

I really need your help on knowing where I can learn the fundamentals of understanding this code. Like, I know the syntax for Python and loops and all that but I don't know anything about classes or objects or even how you could do self.head.next at 4:10. Could you guide me on where I could learn those fundamentals? Any help is appreciated, thank you.

mohamedelgaili
Автор

complexity of appending at ending of the single linked list is On ?

fabersoaks
Автор

Nice video. Why are you pointing the tail to the head? self.tail = self.head

markokafor
Автор

when doing the get method in the single linked list, are we not counting head and tail when considering the index in the linked list as per your code if I pass 0 to the get function
I will be getting the node value next to the head and not the head.
@NeetCodeIO please do reply

sharmagkachannel