Python Data Structures #2: Linked List

Поделиться
HTML-код
  • Опубликовано: 28 дек 2024

Комментарии • 355

  • @Noooname945
    @Noooname945 7 лет назад +66

    @Brian Faure. Thanks for your tutorial. I really appreciate for your efforts to make this tutorial. After watching your vedio , I am confused by one thing. The append function doesn't show the great advantage of the linked list. Could you give us more explanation about this. I think one great merit for linked list is: when we want to insert a node into the list, it just need to change the pointer instead of moving the items in the list to create an gap and then inserting the new item into the list. In the linked list, when we want to insert an node, we just need to change two pointers, which helps us save time, especially the list contains millions of node. But your append function, it needs to iterate to find the last node and then add a new node. This doesn't show the virtue of the linked list. So I am think about the append function whether we could just add the new node at the end of the linked list without iteration. Thanks for your help.

    • @BrianFaure1
      @BrianFaure1  7 лет назад +53

      Hi Xiufeng, thanks for the nice words! Yes the way the append function works currently is O(n), and is not the most efficient. By adding in an extra class member variable, we can call 'tail' for example, we can reduce the complexity of the append function down to constant time, or O(1). A possible implementation could be as follows:
      > def append(self,data):
      > new_node=node(data)
      > self.tail.next=new_node
      > self.tail=new_node
      Take note that for this to work, we will need to declare this 'tail' variable in the constructor of the class:
      > def __init__(self):
      > self.head=node()
      > self.tail=self.head
      If you wish to take this approach, you'll also need to be careful to set the 'tail' correctly inside of the 'erase' function (for example, if you try to erase the last element in the list, you'll need to set the tail to the _new_ last element). The following 'erase' function includes a single 'if' statement which should achieve this:
      > def erase(self,index):
      > if index>=self.length() or index print "ERROR: 'Erase' Index out of range!"
      > return
      > cur_idx=0
      > cur_node=self.head
      > while True:
      > last_node=cur_node
      > cur_node=cur_node.next
      > if cur_idx==index:
      > last_node.next=cur_node.next
      > if last_node.next==None: self.tail=last_node ## *Here is where we set the tail*
      > return
      > cur_idx+=1
      I've done some simple tests with this new implementation and it seems to be working, but feel free to let me know if you find any issues or have any other questions! I'm going to pin this comment so any others with the same question can see it.

    • @hoangminhnguyen2191
      @hoangminhnguyen2191 5 лет назад +1

      Hello, I have a question about the way you append new object with self.tail: why setting both self.tail and self.tail.next equal to next_node. Does this mean you set the last element (after the tail) equal to the new node and then set the tail of the list to that node?

    • @skillfulactor09
      @skillfulactor09 5 лет назад

      Can you make more I love yours do you have stuff on graphs or heaps or merge sort

    • @JF-di5el
      @JF-di5el 5 лет назад +4

      So Chinglish

  • @LemesaElias
    @LemesaElias 10 месяцев назад +12

    I struggled a lot with DSA until I found this channel. Now I struggle a lot less thanks to you.

  • @domss1174
    @domss1174 6 лет назад +186

    3:40 node class, 5:00 linked list class, 6:12 linked list-APPEND method, 7:55 linked list-get LENGTH method, 9:22 linked list-DISPLAY LIST method, 11:31 linked list-get DATA method, 14:50 linked list ERASE method

    • @AbdulSamad-qv4tr
      @AbdulSamad-qv4tr 4 года назад

      THANK YOU

    • @seanli75
      @seanli75 3 года назад +1

      Thanks for the timestamps man! It was really helpful!

  • @MCMB29
    @MCMB29 2 года назад +11

    5 years later and this is still a great video! Awesome in-depth explanation.

  • @code4code857
    @code4code857 6 лет назад +46

    I was a beginner and struggled a lot for the right content and pace which suited me. I have started watching your videos and I must say the concepts are taught very well. At most places I see people just giving presentation through slides and your videos teach us how to implement them. My request to you is to please put more videos in this very playlist covering topics such as Heaps, Recursion etc . Basically the topics which you have'nt uploaded here. You're doing a great job sir. Your efforts can make someone's career. Someone like me. Thank you and have a nice day !

  • @gabrieldewraj3502
    @gabrieldewraj3502 3 года назад +5

    This man deserves an award for how well he broke down every concept!

  • @austinbao
    @austinbao 3 года назад +2

    I have searched through RUclips to find someone to explain Linked lIsts and I gotta say, your video was the most helpful. Thank you so much!

    • @BrianFaure1
      @BrianFaure1  3 года назад

      Glad to hear it helped you, thanks for watching Austin!

  • @yunsizhang3847
    @yunsizhang3847 3 года назад +4

    Agree. The current appending solution is O(n) not O(1). Your solution should be O(1), which is the benefits of using Linked List
    .

  • @Julia-rq7uj
    @Julia-rq7uj 6 лет назад +14

    i must say, this is the simplest coding of linked list i've seen so far on the internet

    • @sauravraj1085
      @sauravraj1085 4 года назад

      Lolll, this is the most general and common code for linked list.

  • @softwareengineer8923
    @softwareengineer8923 Год назад +2

    Your explanation is too clean and lucid.Thanks for a great video!

  • @MrBloodshadow323
    @MrBloodshadow323 2 года назад

    I'm a beginner at coding and this was very helpful. I also liked the cadence of your voice, it helped me from not zoning out. Keep it up!

  • @djlazer1
    @djlazer1 Год назад +1

    I love you dude thanks for explaining this stuff so clearly. So many other channels explain this stuff so badly, but you make it so easy to understand.

  • @apalsnerg
    @apalsnerg 10 месяцев назад

    Thank you so much for this! This is just what I needed to understand linked lists properly!

  • @tguigz
    @tguigz 5 лет назад +6

    I know this is more geared to beginners but a better way to do length for an object is by levying your own dunder method or "magic method". You can do this by defining your function as: def __len__(self): this will let you leverage the length of your linked-list by using len(your_linked_list) rather than using your_linked_list.length(), which will be more pythonic and user friendly. You could also use def __getitem__(): for yor get function.

  • @mr-engin3er
    @mr-engin3er 3 года назад

    I searched for python linked list and watch many tutorials but I found this tutorial is best.
    expect more python tutorials from this channel.

  • @zulfiqarali1212
    @zulfiqarali1212 7 лет назад +12

    beleive me you are one of the greatest teacher of coding. oh its true ,,,its dammmnnn true... keep it up.

  • @bhavishahadiyal7836
    @bhavishahadiyal7836 Год назад

    Best explanation ever please never stop making great videos, we will subscribe

  • @mouseen92
    @mouseen92 7 лет назад +3

    Excellent video, really clear, direct, concise and easy to follow. Amazing, so many people on RUclips need to learn a thing or two from you.

  • @alexlencz7346
    @alexlencz7346 6 лет назад +7

    Extremely helpful tutorial! Clear, concise presentation. And Python is also my favorite language!

  • @C-Swede
    @C-Swede 7 лет назад

    You're a great tutor! This feels like it brings me closer to where Python will finally "click" with me.

  • @varunnarayanan6301
    @varunnarayanan6301 2 года назад

    Its 2022 still the best linked list video on python

  • @yajingli1990
    @yajingli1990 6 лет назад +4

    Thank you for making this great tutorial, it's very helpful! I've been struggling with understanding the linked list structure and finally find answers from your video, thank you very much!

  • @ETR12935
    @ETR12935 5 месяцев назад +1

    First dsa video! the keyboard sound was just 🤩

  • @patrickmutuku9579
    @patrickmutuku9579 7 лет назад +3

    I love your tutorials. I wish I could have discovered them before starting CS110 three months ago. Keep up the great work

  • @collintech057
    @collintech057 2 года назад

    Thank You Brian. this video was very helpful. i watched other tutorials and they were confusing. one thing I discovered about algorithm and data structure is that the teacher's use of plain english and well outlined variable is fundamental to understanding the concept easily. i grasped everything you taught in this video but the challenge i face is that once i try to implement it on my own, i run into errors because i don't like the idea of copying people's code rather than either interpreting in a paper or typing them on my own. i have fundamental knowledge of programing and am a web developer. i want you to help me master OOP, DSA and Iterations. Thank You

  • @jordonmarchesano9219
    @jordonmarchesano9219 2 года назад

    awesome man thank you. Been having trouble with data structures but this seriously helped a lot.

  • @darksoul.0x7
    @darksoul.0x7 6 лет назад +6

    I have an error on display function it's say that 'None type' object has no attribute 'data'

  • @rensoagomez
    @rensoagomez 3 года назад

    antipop to the mic and this is gold. thanks a lot.

  • @QVL75
    @QVL75 3 года назад +1

    I love your tutorial video. Excellent presentation. Very clear explanation. 2 thumbs up.

  • @intisharalammisbahul9927
    @intisharalammisbahul9927 3 года назад

    I looked for copper but found diamond. Loved the video, will help me with my exam.

  • @nackyding
    @nackyding 6 лет назад

    Thanks needed a quick refresher on linked list. Going to see if you have double linked list now...thanks again

  • @jpchato
    @jpchato 3 года назад

    my_list = LinkedList()
    my_list.append('3 years later but still great, thanks Brian')
    my_list.display()

  • @emilyli6763
    @emilyli6763 4 года назад +1

    16:42 and a few of other spots, shouldn't we be incrementing the cur_idex by one before the if statement?

    • @codeityourself4847
      @codeityourself4847 4 года назад

      no, becuase if you increment the index before the if statement the index will always start at 1 not 0 so the my_list.get(0) will be None, but if you increment it after the if statement, it will check the index 0 first and the get(0) method will return the first elem if it makes sense. basically if you have it before the if statement, your linked list will always start with index 1 not 0

    • @emilyli6763
      @emilyli6763 4 года назад

      @@codeityourself4847 thank you so much!

    • @codeityourself4847
      @codeityourself4847 4 года назад

      @@emilyli6763 you are welcome

  • @commandprompt7171
    @commandprompt7171 Год назад

    thank you for explaining the erase method, I was confused from another video on how the element gets deleted by just assigning the last node

  • @Abhishek-fe3zs
    @Abhishek-fe3zs 2 года назад

    Your channel is gold

  • @sanjiblamichhane
    @sanjiblamichhane 2 года назад +4

    Good job making this video.
    - append() method and elems.append() might be confusing if you create a method to insert at end with name other than append().

  • @reynaldoruizflores
    @reynaldoruizflores 3 года назад

    Thgank for the tutial as suggestion for future video. How to choose a Data structure? Pros vs Cons. Speed Big O notation

  • @hsoley
    @hsoley 3 года назад

    Best video on the topic

  • @ComSci-student
    @ComSci-student 5 месяцев назад

    Great content Brian. Thank you.

  • @akashp4863
    @akashp4863 3 года назад

    Thank you. i know i can watch the video again and understand it

  • @EugeneMillerErm
    @EugeneMillerErm 4 года назад +2

    I found the concept interesting, I'm not sure where I'd use it over a list. I must say that your code can be made much more efficient by adding a _length variable and incrementing it when you append and de-incrementing it when you erase. No need to iterate when you can store it in an integer. Also __repr__() could be used vs display or perhaps a __str__(). so you could just print(linked_list) __getitem__() or perhaps __get__() could be used so you could linked_list[0] magic methods are kinda cool.

  • @ch33ze0g
    @ch33ze0g 4 года назад +1

    Really dumb question, but in the display method why is cur = cur.next before elems.append? In my head you would want to append to elems first and then move the pointer

    • @quangnhat-uc4ri
      @quangnhat-uc4ri 2 месяца назад

      yeah the same question and he also wrote in the same style in the get fuction . It has been 4 years and do u know why ?

  • @zwj808
    @zwj808 5 лет назад

    Thank you for making such a great tutorial! It really helps me aces the linked list, which I kept avoiding before. Finally found your clear step by step tutorial! It is so cool and excellent, thank you!

  • @Skeeb04
    @Skeeb04 3 года назад

    i just wasted 2 hours too complete this get method finally thanks

  • @motheotreasurepuso0724
    @motheotreasurepuso0724 Год назад

    Great video. On your erase, I think it is essential to reassign the self.head for when erase is called at index= 0 so that it does not stay as None

  • @charlielin188
    @charlielin188 4 года назад +1

    Thank u for making this video, neat code and clear explanation, 10/10. I really hope one day I can be as intelligent as you are.

  • @lamedev1342
    @lamedev1342 3 года назад

    Very useful, I'm in gr 11 and learning this it was well explained!

  • @grifmang
    @grifmang 4 года назад +1

    Just wanted to add that the Doubly Linked List also has access to the last node, or the tail. Where the Singly Linked List doesn't.

  • @PrinceAdom
    @PrinceAdom Год назад

    Instead of doing another costly iteration through the linked list to find the size of it. We can add a self.length variable to the init() with an initial size of 0, and then add a 1 in the append() and a subtract a 1 in the remove method

  • @dennisearle
    @dennisearle Год назад

    Thanks, Brian. Really helpful.

  • @dontworryaboutit17
    @dontworryaboutit17 5 лет назад

    This makes sense. My prof should not be teaching, haha. Thanks for explaining while making it so concise.

  • @b.f.skinner4383
    @b.f.skinner4383 3 года назад

    Fantastic explanation of the topic, thank you!

  • @RishiKumar-zs4vj
    @RishiKumar-zs4vj 4 года назад

    Really Useful keep on doing more videos please

  • @ad2894
    @ad2894 6 лет назад +1

    For the length method, should total + 1 not be returned since the last node won't be added to the total (because it doesn't satisfy the condition of the while loop)?

  • @vipinamar8323
    @vipinamar8323 4 года назад +5

    The length function is wrong, you need to add 1 to account for the last node.

    • @clashgamers4072
      @clashgamers4072 3 года назад

      The head node(empty node at the start) will count towards the total so it kinda cancels out

  • @GoldPlatedINDIAN
    @GoldPlatedINDIAN 6 лет назад +6

    It would be simpler if when you append a new node, you simply point it to the head node and set the head as the node you just added. Saves you from iterating through all the nodes you've added (could be a large number) to add one to the end.

    • @dannyskillet7315
      @dannyskillet7315 Год назад

      Pretty silly statement. I think in general terms when you "append" to a list, you are specifically adding to the end of the list not to the beginning.

  • @bactran7799
    @bactran7799 3 года назад

    8:36 I think While should be cur != None, if we use while cur.next != None it will get length - 1 of total

    • @nestoriyagamongerto7881
      @nestoriyagamongerto7881 3 года назад +1

      Yeah!
      I think in that way too. Indexing start from 0, but size counting - from 1

  • @polsiv
    @polsiv Год назад

    Great video dude, it helped me a lot!

  • @bahaya7123
    @bahaya7123 2 года назад

    at 16:50, why does current node need to be equal to self.head? whats the point of this?

    • @vortsynx3151
      @vortsynx3151 2 месяца назад

      Because you want to start at the first index of the list since your idx=0.

  • @chandragirivishnuvardhan7654
    @chandragirivishnuvardhan7654 4 года назад +1

    @Brian Faure, Your explanation is pretty awesome. But, I think you have missed the "insert" operation.

  • @gate7689
    @gate7689 5 лет назад +1

    I have a doubt. In the "append" method, new_node = node(data), each time The append method is called, an object of node class is created with the same name (new_node). Why doesn't this produces an error? wouldn't the object be garbage-collected?

    • @BrianFaure1
      @BrianFaure1  5 лет назад +1

      Hi, this isn't an issue because the Python garbage collector uses reference counting to decide what to remove from memory and since we are setting the 'next' node pointer of the prior node equal to this node there will always exist some reference to it (until it is deleted from the list).

    • @gate7689
      @gate7689 5 лет назад

      @@BrianFaure1 Thank you. That clears my doubt.

  • @lilyan4830
    @lilyan4830 Год назад

    What textbook are the screenshots from? For example at time stamp 3:25

    • @lilyan4830
      @lilyan4830 Год назад

      especially 3:26 and 3:27

  • @akboss4341
    @akboss4341 4 года назад

    Man !This is so crisp ! Nice tutorial

  • @sarvesh_k
    @sarvesh_k 5 лет назад +1

    hi @brian,
    getting error on if check
    if index >= self.length():
    TypeError: '>=' not supported between instances of 'int' and 'NoneType'

    • @BessedDrest
      @BessedDrest 5 лет назад

      I had the same error. It's possible that in your length() function you are printing the total, instead of returning it. self.length() needs to RETURN a value, not PRINT

  • @turk-money
    @turk-money Год назад

    Great video, thanks for the post.

  • @urass1765
    @urass1765 3 года назад

    This video is very helpful for me to understand the linked list. I thought it would be very complicated 🤔

  • @BL-om2hn
    @BL-om2hn 6 лет назад

    10:24 shouldn't the elems.append switch position with the line above so that the display function could also print out the first node?

    • @BrianFaure1
      @BrianFaure1  6 лет назад +1

      That would be the case if the self.head node actually contained data but with this approach we use the self.head node simply to point to the first true node in the list, thus we don't need to worry about printing its content. Thanks for commenting!

  • @umerehsan6677
    @umerehsan6677 2 года назад

    Great work. Really appreciated

  • @YorkshireSpud
    @YorkshireSpud Год назад

    Thanks for this video, you've explained the code and data structure really thoroughly and I'm starting to understand the implementation of LinkedLists.
    However, I found a bug with the length method that you wrote in the video. I found that if you try to access the last element of LinkedList it will raise the error due to the count starting at 0 rather than 1. The fix is simply start the count at 1 because it counts the empty node and makes the final element inaccessible via the get method that you defined.
    Also, with the change above, you want to move the `if cur_index == index: return cur_node.data` statement to the top of the while loop or you'll get an error stating cur_node.data is None (the get method)

  • @nestoriyagamongerto7881
    @nestoriyagamongerto7881 3 года назад +1

    Awesome!
    But in method for calculate length I see some sort of problem.
    If counting start from 0 - head will not count. I understand, that list index start from 0, but in length method 0-element must counting like another 1. Or this is mistake?

    • @vortsynx3151
      @vortsynx3151 2 месяца назад

      >> cur = self.head
      it started from head
      >> while cur.next!=None: > idx+=1

  • @CowCow5354
    @CowCow5354 7 лет назад +3

    For the length method, can't you just initialise a length variable and +/-1 to it everytime u add/delete a node?

    • @BrianFaure1
      @BrianFaure1  7 лет назад +4

      Yes, and that would certainly be more efficient in most use cases. Thanks for watchin!

  • @denysivanov3364
    @denysivanov3364 2 года назад

    Great video! Thanks for your work!

  • @surajkumarkabbur2550
    @surajkumarkabbur2550 6 лет назад

    Awesome video..👌👌
    One of the best I've seen for python tutorials.👌

  • @anjalipc8649
    @anjalipc8649 4 года назад

    Thank you sir..It was very informative.

  • @ROC4Life96
    @ROC4Life96 6 лет назад +1

    What colour scheme did you use for your command line? I'd like to switch my terminal to that colour scheme

    • @BrianFaure1
      @BrianFaure1  6 лет назад

      It's the default Ubuntu terminal color scheme with some extra background opacity ( askubuntu.com/questions/941734/whats-the-rgb-values-for-ubuntus-default-terminal-unity ). If you're on Windows 10 you can actually install the Ubuntu terminal directly and take advantage of all it's sweet features (and also the color scheme), there's some info on that here docs.microsoft.com/en-us/windows/wsl/install-win10 . Otherwise if you're on a lower version of Windows you can install Cygwin and customize the color scheme to look like this in the appearance settings. Similarly if you're on OSX or another Linux distro you'll have to tweak the appearance settings to match.

  • @maanupurisai398
    @maanupurisai398 4 года назад +1

    I have a doubt.. If there is only one element say 5... Self. Data is 5 and self.next= none right?.. When you run "length" loop..the cur.next is equal to none, so it comes out and gives the length as 0...but the length should be 1 right?

    • @vortsynx3151
      @vortsynx3151 2 месяца назад

      cur = self.head
      cur.next = None

  • @MahiAbrarAmer
    @MahiAbrarAmer 7 лет назад +1

    I don't understand one thing.. in your functions, you repeatedly used a loop comparing to 'cur.next' but never initialized its value. What does it initially make its comparison to, before entering the loop? (example, line 15. while cur.next!=None)

    • @MahiAbrarAmer
      @MahiAbrarAmer 7 лет назад

      and even if 'cur' replaces 'self' in the node class, we already initialized it as 'None'. So how will we enter the loop, as cur.next IS equal to None in the first place? Thanks for the hardwork btw

    • @BrianFaure1
      @BrianFaure1  7 лет назад

      I think you got the initialization part, the 'next' value of the 'node' class is initialized in the 'node' class constructor to a default value of None, so when we say 'cur=self.head', we're setting 'cur' equal to an instance of the 'node' class, whose 'next' value was set to 'None' by default (this value of 'None' is changed once we insert a single item). For the 'while' loop on line 15, if there isn't anything already in the linked list (the length is 0) then we will pass straight over the loop (won't even do a single iteration) because 'cur.next' WILL equal None, obviously, in this case this will no longer be true after a single call because, since we're appending on an item, the 'next' value will no longer be 'None' but will instead be set equal to another instance of the 'node' class. Lemme know if this clears it up at all.

  • @Deshwal.mahesh
    @Deshwal.mahesh 2 года назад

    Your insertion takes O(n) time where time for Linked Lists are O(1)

  • @dani-re9ew
    @dani-re9ew 2 года назад

    So the head of the linked list is a node that doesent have data and only have next?

  • @谢生-b2g
    @谢生-b2g 2 года назад

    @Brian Faure. Thanks for your tutorial.

  • @unclesam997
    @unclesam997 6 лет назад +1

    Super good explanation!

  • @vivekkuma1
    @vivekkuma1 5 лет назад

    Excellent Explanation Sir

  • @aneeshsabnis4435
    @aneeshsabnis4435 5 лет назад +2

    What's the difference between using != and 'is not'?

    • @MrCk0212
      @MrCk0212 5 лет назад +1

      a != b is to check if a and b are not equal in values and "a is not b" is to check if a and b are not the same object (same memory address).

    • @aneeshsabnis4435
      @aneeshsabnis4435 5 лет назад

      @@MrCk0212 Oh, I see. So when comparing to 'None' we would use 'is not'? Thanks

  • @hemanthkumarar
    @hemanthkumarar 8 месяцев назад

    At 11:50
    I think it should be
    if index > self.length()
    instead of index >= self.length()
    This will ignore the last element and it cannot be accessed.
    I am still a newbie, correct me if I am wrong.
    Anyway, great series, thank you sir

    • @vortsynx3151
      @vortsynx3151 2 месяца назад

      Python list index start from 0 while .length() return how many data is inside the list.
      Say I have this list...
      list = [1, 2, 3, 4, 5]
      The max index is 4, because the first address started from 0.
      list[0] = 1
      list[1] = 2
      list[2] = 3
      list[3] = 4
      list[4] = 5
      See how the last index is 4.
      If you try to print the same list using list.length(), it will return 5 as there is a total of 5 data inside the list.
      If you do index > self.length(), it would make it possible for the user to try to return list[5], which is non-existent as the max index is only 4.

  • @saravana8016
    @saravana8016 6 лет назад

    In the erase() we are just removing the pointer to the element that we dont want..But the element that we want to delete is still in the memory and occupies space for no purpose??😕😕

    • @BrianFaure1
      @BrianFaure1  6 лет назад

      Hi Sarah, in Python if there aren't any references to an object (if it can't be accessed from the code any longer) the garbage collector should deallocate the memory associated with the object. You can read more about this if you google for 'python garbage collection' but this is a pretty good resource: rushter.com/blog/python-garbage-collector/

    • @saravana8016
      @saravana8016 6 лет назад

      @@BrianFaure1 Thanks man

  • @GuitarreroDaniel
    @GuitarreroDaniel 3 года назад +1

    This gets the idea of a linked list. However, it's not a very efficient implementation. With that append method you'd be iterating the WHOLE linked list before each insertion, and avoiding that kind of insertion is the very reason of using a Linked List. This could be easily fixed by keeping track of the Linked List's tale node.

  • @nostestwu8689
    @nostestwu8689 5 лет назад +1

    for the len function, i think u should use curr instead of curr.next for the loop. Your code will give len -1 for the result

    • @bakerct90
      @bakerct90 5 лет назад

      I think it works. In the len function it is technically counting the head which doesn't have data and not counting the last node. I believe it works as he intended though.

  • @RahulKumar-tu7fm
    @RahulKumar-tu7fm 6 лет назад +1

    @Brian Faure You did great tutorial. I really enjoyed the tutorial.

  • @shrikantkarki4966
    @shrikantkarki4966 6 лет назад

    Thank you sir.It helped a lot.Keep posting videos

  • @jonassteinberg3779
    @jonassteinberg3779 2 года назад

    You use function naming convention for your classes which would become very confusing eventually especially for new people. For example instantiating a class would look identical to assigning a function to a variable.

  • @kelliroache2041
    @kelliroache2041 6 лет назад +1

    Awesome tutorial! Thank you

  • @glenfernandes253
    @glenfernandes253 3 года назад

    Fantastic explanation! Thanks!

  • @wangnan173
    @wangnan173 2 года назад

    THANK YOU really!!!
    The only thing I can't understand is the % right before my_list.get(). What does it do exactly?

  • @kewtomrao
    @kewtomrao 4 года назад

    The video was really helpfull.I have one doubt.In c the head pointer points at the first node.Here too it does that but it is also a node right?So the first node of the linked list will be the head?Am i correct?

  • @gabinkundwa7215
    @gabinkundwa7215 3 года назад

    thank you for this tutorial it is simple and helpful

  • @SLowe-xi3fq
    @SLowe-xi3fq 8 месяцев назад

    Can't we just say while current != None (or while current)? we dont necessarily need to make sure we have 2 nodes before null right?

  • @РоманРахлин
    @РоманРахлин 3 года назад

    I got it right? When we implement the erase function we're actually just changing pointers and that's it? So the object is still in memory and we're just go through it when we display all elements?

    • @BrianFaure1
      @BrianFaure1  3 года назад +2

      Hi Roman that is correct except in Python when we remove all pointers/references to an object the “garbage collector” effectively erases it from memory for us!

    • @РоманРахлин
      @РоманРахлин 3 года назад

      @@BrianFaure1 Thank you

  • @vaibhavtiwari2941
    @vaibhavtiwari2941 5 лет назад

    Thanks for your wonderful tutorial.
    I was stuck in the linked list part from about a week .
    You were awesome

  • @nuandatun
    @nuandatun 4 года назад

    Thank you so much! Your explanation really helped!

  • @jingyuchang1885
    @jingyuchang1885 6 лет назад

    Thank you very much Brian! You videos are really amazing and helped me a lot! i really appreciate for all your effort! Just can't thank you enough!

    • @BrianFaure1
      @BrianFaure1  6 лет назад +1

      No problem, thanks for watching Jingyu!