2 Simple Ways To Code Linked Lists In Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

ความคิดเห็น • 105

  • @ErastusK
    @ErastusK 4 ปีที่แล้ว +90

    Can't underestimate the value of first MANUALLY creating a linked list as you did in the beginning, helps a tonne understanding the normal way of creating one.

    • @AnthonySistilli
      @AnthonySistilli  4 ปีที่แล้ว +22

      I definetly agree! When I was practicing for interviews, I created every data structure from scratch and it helped me understand them 1000000% more than before. Glad you liked it!

    • @benchmarks1016
      @benchmarks1016 3 ปีที่แล้ว +7

      True, I was going nuts on other tutorials since I couldn't understand it but ur showed us the basic steps
      Thank you.

    • @UnknownSend3r
      @UnknownSend3r 2 ปีที่แล้ว +3

      @@AnthonySistilli it only ever clicked to me after you manually done it.

  • @scullyy
    @scullyy 2 ปีที่แล้ว +14

    This is the only Linked Lists tutorial I've seen where the tutor seem to care about the viewer *understanding* what is being taught.

  • @harturmainardi
    @harturmainardi 3 ปีที่แล้ว +39

    In the current version of python, you have to
    print(currentNode.value, "->", end=" ")
    in order to print in the same line as he did in the first example.

    • @study_with_thor
      @study_with_thor 3 ปีที่แล้ว

      thanks a lot bro

    • @cbro1744
      @cbro1744 3 ปีที่แล้ว

      yes

    • @roros2512
      @roros2512 3 ปีที่แล้ว

      thanks!

    • @test-hj9lx
      @test-hj9lx 2 ปีที่แล้ว +2

      I was stuck at this point to understand why is my code not printing in single line, this helped...Thanks a lot !

    • @hendrag593
      @hendrag593 2 ปีที่แล้ว

      Thank you very much Hartur for this new information.

  • @valeriagarcia8476
    @valeriagarcia8476 3 ปีที่แล้ว +14

    My professor had an hour long lecture on this topic, and I understood it far better with your video. Thank you!

  • @hemanthkumarar
    @hemanthkumarar หลายเดือนก่อน

    If there was an award for "Best Linked List explanation for Beginners in Python", this video would definitely get it.

  • @maryamalmasharawi7421
    @maryamalmasharawi7421 2 ปีที่แล้ว +2

    I have watched more then 10 other videos on linkedlists in python. Yours was truly the first one where I was really able to understand the concept of the code!
    Many thanks

  • @AjeetSingh-oo6nt
    @AjeetSingh-oo6nt 5 ปีที่แล้ว +7

    After watching number of videos on linked list finally I understood. Thanks a ton. Your approach is awesome

  • @cozmos1553
    @cozmos1553 ปีที่แล้ว

    i watched the video with no audio, and still understood everything. Thats how easy he made it for us. Thankyou!

  • @premspal2496
    @premspal2496 3 ปีที่แล้ว +3

    Hi Anthony,
    Thank you so much for your efforts. Your explained LinkList very well. Whenever I get confuse I always come here and watch this video again. It just gives my more clarity every time .
    Best wishes!

  • @kate_chengdu
    @kate_chengdu 3 ปีที่แล้ว +1

    nice design - the 2 separate ways. after understanding the 1st way, which is very easy to be understood, grasping the ideas in the 2nd way becomes easy too. thank you!

  • @joshuaasogwa4247
    @joshuaasogwa4247 3 ปีที่แล้ว +3

    Thank you so much for this video..It helped my understanding..you cant imagine how hard it has been to understand this concept..The first manual part also helped me understand this..I dont think I would have understood it without the first part..

  • @study_with_thor
    @study_with_thor 3 ปีที่แล้ว

    looking for thousands of videos but couldn't understand this video is a life-saver

  • @bhargavpraveen737
    @bhargavpraveen737 3 ปีที่แล้ว +2

    watched soo many videos,but it was hard for me to understand....thank you very much for the wonderful and simple explanation

  • @LightningSpeedtop
    @LightningSpeedtop 2 ปีที่แล้ว

    Damn, this is definitely the best tutorial I've seen on linked list

  • @TradeWithJon
    @TradeWithJon 3 ปีที่แล้ว

    I watched a ton of videos on this, but this video really clicked for me, especially the beginning part with manually creating the linked list, thank you!

  • @sirius_academy
    @sirius_academy ปีที่แล้ว

    After watching numerous videos, this finally explains everything. My search has ended.

  • @SW-nx4jz
    @SW-nx4jz 3 ปีที่แล้ว

    This is the BEST video on youtube on Linked Lists. It's so simple and easy to understand. I just subscribed!

  • @tjbruno5500
    @tjbruno5500 4 ปีที่แล้ว +7

    This helped me a lot, thanks for spending the time to create it!

  • @ShamleThilaksiri
    @ShamleThilaksiri 9 หลายเดือนก่อน

    by far the best linked list python tutorial , Kudos ...

  • @verryberrypie
    @verryberrypie 3 ปีที่แล้ว +4

    This was so helpful, thank you! This is the best video on linked lists and your teaching style is very thorough. Would you be able to do similar videos on other data structures (binary trees, AVL trees, heaps, etc) in Python as well?

  • @harshavardhanachary3863
    @harshavardhanachary3863 4 ปีที่แล้ว +2

    thank u so much, I was vexed after referring to various videos on linked-lists ,finally I understood urs ...Great explanation

  • @tamharsingh7550
    @tamharsingh7550 2 ปีที่แล้ว +2

    Really good explanation dude. You just made it easier, I had so many questions about implementation before watching this video. You clarified a lot them!
    Would be great if you can make more videos on other DS implentation in python.

  • @MatisCCCC
    @MatisCCCC ปีที่แล้ว

    best tutorial on linked lists i've seen so far!!!!

  • @udayptp
    @udayptp 3 ปีที่แล้ว +1

    Llist with python is really confusing but you have explained it very well.

  • @muradquliyev6448
    @muradquliyev6448 5 ปีที่แล้ว +5

    Thanks. Finally, I have found what I want.

  • @iamdare
    @iamdare 4 หลายเดือนก่อน

    Gosh! You’re such an intelligent teacher. Thank you so much for this.

  • @yagyasen8195
    @yagyasen8195 3 ปีที่แล้ว

    You explained in such lucid manner. Thanks a million Anthony.

  • @shubhamkadam7224
    @shubhamkadam7224 4 ปีที่แล้ว +1

    its easiest way to implement linked list thanks a lot for your video sir....

  • @joegodindata
    @joegodindata 2 ปีที่แล้ว

    best python coding video on LinkedLists thank you

  • @HonduranHunk
    @HonduranHunk 7 หลายเดือนก่อน

    Best explanation I've found on TH-cam. Thank you sir 🙏

  • @Sillysmiles76
    @Sillysmiles76 2 ปีที่แล้ว

    Thank you so much sir for this vedio, I thought I would never get linked list implementation, but after this vedio it's never been same again.

  • @thelifeofsarath
    @thelifeofsarath 3 ปีที่แล้ว +1

    I'm so lucky that I found your video! Thanks a ton! Subscribed!

  • @saravanakumarn6895
    @saravanakumarn6895 ปีที่แล้ว

    you literarlly saved my life sir

  • @pratikvyas3384
    @pratikvyas3384 6 ปีที่แล้ว +1

    You are just amazing! Please be continue to your channel... please sir!

  • @tanbirpradhan
    @tanbirpradhan 2 ปีที่แล้ว

    Thank you so much,,
    I will understand a great concept after many classes on youtube.
    The first one is very easy to understand.

  • @amanueltsehay3119
    @amanueltsehay3119 ปีที่แล้ว

    I just understood the whole concept by just this video

  • @deadshotxi3970
    @deadshotxi3970 5 ปีที่แล้ว +1

    Great and clear explanation bro. Subscribed!!

  • @fazliddinfayziev-qg1vg
    @fazliddinfayziev-qg1vg 9 หลายเดือนก่อน

    Bro you are HERO. 😁😁😁😁. Such amazing explanation. Thank you brother.

  • @hriteshsaha348
    @hriteshsaha348 2 ปีที่แล้ว

    very easily explained. really thanks a lot sir.

  • @raparaparapaDum
    @raparaparapaDum ปีที่แล้ว

    04:32 the currentNode.nextNode is not 7 but Node2. Actually the value of currentNode.nextNode (when currentNode is Node1) is 7. Did I get it right?

  • @imchaul1901
    @imchaul1901 ปีที่แล้ว

    Wait, I don't know how it's working for you, but in line 17 and 18 around the timestamp 4:42, how's node1.nextNode = node2? Shouldn't it be node1.nextNode = node2.value?

  • @2e3crescens
    @2e3crescens 2 ปีที่แล้ว

    omg, helped me a bunch with implementing linked lists!

  • @adeebhasan515
    @adeebhasan515 4 ปีที่แล้ว +1

    Great explanation!
    The code is working fine but at the end i get an attribute error at the print line "currentNode.value"
    It says : 'NoneType' object has no attribute 'value'
    The output i get is:3->44->55->Traceback
    The rest of the code is working except printlist function

  • @hakanaktas8729
    @hakanaktas8729 2 ปีที่แล้ว

    Thanks, bro it's amazing, I hope you continue to produce like this video

  • @ZatosK
    @ZatosK 4 หลายเดือนก่อน

    why did that make sense, thank you

  • @kaysar1230
    @kaysar1230 2 ปีที่แล้ว

    thank you.Atlast I understand properly😊😊

  • @danielhegyi5037
    @danielhegyi5037 2 หลายเดือนก่อน

    Great explanation! Thanks a lot.

  • @enesbozkaplan
    @enesbozkaplan ปีที่แล้ว

    Can you also please share the complexity of the functions?

  • @guddu11000
    @guddu11000 ปีที่แล้ว

    Hello Anthony, i couldn't understand print statement od solution 1 , while iterating you are assigning currentNode but how does it knows how many heads are there as we have in your example and you have assigned node1.head for the first time but how the loop is taking head of node 2 and node 3

  • @proevo7781
    @proevo7781 4 ปีที่แล้ว

    Hi @anthony Thanks for this great tutorial . can I ask you why did you write "retun" in 7.21

  • @infayewebelieve
    @infayewebelieve 5 ปีที่แล้ว

    When you put your nodes in quotes, are they actually strings instead of integers?

  • @z1pppyyyy
    @z1pppyyyy 4 ปีที่แล้ว +1

    most sincere, thanks

  • @loveen3186
    @loveen3186 2 ปีที่แล้ว

    you are truly amazing, thank you for sharing

  • @shuvadas7314
    @shuvadas7314 4 ปีที่แล้ว

    thanks, sir ... thanks a lot, finally i solved my problem

  • @suryatej839
    @suryatej839 3 ปีที่แล้ว

    Very easy to understand, tq u

  • @surajk508
    @surajk508 3 ปีที่แล้ว

    how can you use attribute of linkedlistnode class in linkedlist class? are these two class related in some ways?

  • @hi1235688
    @hi1235688 2 ปีที่แล้ว

    amazing video, much appreciate it

  • @janwojdat7028
    @janwojdat7028 4 ปีที่แล้ว +1

    Can somebody explain why print function doesn't have ()? im getting an error when trying to run the code

    • @corbettknoff5123
      @corbettknoff5123 4 ปีที่แล้ว

      @Samuel Benson Thank you! I was wondering the same thing.

    • @chenyan4444
      @chenyan4444 3 ปีที่แล้ว +1

      It is the difference of Python 2 and Python 3.

  • @tassa2041
    @tassa2041 3 ปีที่แล้ว

    Hello, I used your method to store book names in my linked list and I want to sort them in alphabetical order but I can't find the functions. Can anyone help me out?

  • @miteshbagwe9765
    @miteshbagwe9765 4 ปีที่แล้ว

    Great explanation!

  • @autismo1969
    @autismo1969 3 ปีที่แล้ว

    amazing explainantion thanks a lot

  • @vizcarraorozco4740
    @vizcarraorozco4740 ปีที่แล้ว

    wow! awesome! thank you so much!

  • @Infinite1216
    @Infinite1216 5 ปีที่แล้ว

    print currentNode.value, "->",
    What does this line do? Why add a ->? Using a comma?

  • @sukhdeepsingh9650
    @sukhdeepsingh9650 3 ปีที่แล้ว

    thanks a lot that was very helpful .

  • @momochi5096
    @momochi5096 2 ปีที่แล้ว

    what does the insert function return?

  • @kayalarasan9221
    @kayalarasan9221 ปีที่แล้ว

    Thanks dude ❤

  • @amanprasad-vb4qq
    @amanprasad-vb4qq ปีที่แล้ว

    Nice video, helpful

  • @HamzaAli-hh7ub
    @HamzaAli-hh7ub 10 หลายเดือนก่อน

    what happens when we run into the break statement ? we simply move out of the loop. But then what does the function insert return ?

    • @arshian7670
      @arshian7670 9 หลายเดือนก่อน

      It's a procedure
      it doesn't return anything
      however you can add a return statement like "value inserted"

  • @ealehnn
    @ealehnn 2 ปีที่แล้ว

    Please I thought we insert a new node Infront of the head but then I see that you are inserting at the end

  • @jaquasianicole4371
    @jaquasianicole4371 2 ปีที่แล้ว

    Thank you so much

  • @elishawangila-i5g
    @elishawangila-i5g 11 หลายเดือนก่อน

    good work

  • @christopherjamescastillo1208
    @christopherjamescastillo1208 4 ปีที่แล้ว

    REALLY HELPFULLLL

  • @ReplayEcho
    @ReplayEcho ปีที่แล้ว

    What’s a constructor ?

  • @webapplicationguide3798
    @webapplicationguide3798 5 ปีที่แล้ว

    Thanks a lot !!

  • @joshuaudo3072
    @joshuaudo3072 ปีที่แล้ว

    Thank bro❤

  • @afshinnikkhoo2013
    @afshinnikkhoo2013 6 หลายเดือนก่อน

    Nice!

  • @sergey5618
    @sergey5618 3 ปีที่แล้ว

    How it is possible that you have print output in one row in pycharm? in Python 3 print() executes every row.
    I have like that, but wonder how to do it like in your output
    None
    3 ->
    None
    3 ->
    44 ->
    None
    3 ->
    44 ->
    55 ->
    None

    • @cabjelen
      @cabjelen 3 ปีที่แล้ว +1

      I also had to look this up. All we need in Python 3 is to add the "end" argument (my reference was www.tutorialspoint.com/how-to-print-in-same-line-in-python).
      Therefore, line 25 in Python 3 ends up like so:
      print(currentNode.value, "->", end = " ")

    • @varunshrivastava2706
      @varunshrivastava2706 3 ปีที่แล้ว

      @@cabjelen And what about this line - print currentNode.value,"-->", This should clearly throw some error.

    • @cabjelen
      @cabjelen 3 ปีที่แล้ว

      @@varunshrivastava2706 Sorry I mistyped the line number. In order to get the same output layout, the Python 2 line print currentNode.value,"-->", becomes in Python 3 print(currentNode.value, "->", end = " ")

    • @varunshrivastava2706
      @varunshrivastava2706 3 ปีที่แล้ว +2

      @@cabjelen You don't have to be sorry about it Elena and thanks for explaining 😃

    • @helapubggaming1108
      @helapubggaming1108 3 ปีที่แล้ว

      use end=' '

  • @unspoken2409
    @unspoken2409 ปีที่แล้ว

    Must be Python 2 code as the parentheses are not required around the print statement.

  • @abhishek-gu6qt
    @abhishek-gu6qt 8 หลายเดือนก่อน

    tq man

  • @tarekghosn3648
    @tarekghosn3648 2 ปีที่แล้ว

    yes

  • @chriskeo392
    @chriskeo392 3 ปีที่แล้ว

    Why do we need to know this? I always see this in cs classes!

  • @EliasGolbertcookie
    @EliasGolbertcookie 10 หลายเดือนก่อน

    love it

  • @muhammadabdurrazzak6024
    @muhammadabdurrazzak6024 2 ปีที่แล้ว

    please share the codes

  • @fryphillipj560
    @fryphillipj560 6 ปีที่แล้ว +3

    noice

  • @priyeshpandey7128
    @priyeshpandey7128 2 ปีที่แล้ว

    He has done many mistakes but how he get the accurate answer

  • @chenyan4444
    @chenyan4444 3 ปีที่แล้ว +2

    Hi Anthony,
    Thank you for your wonderful explanation! I really appreciate it!
    But when I copy the code in the Pycharm, it seems didn't work well because of the difference between Python 2 and Python 3. Can you update the first code to Python 3 when you get a change?
    Many thanks!