Binary Trees in Python: Introduction and Traversal Algorithms

Поділитися
Вставка
  • Опубліковано 15 гру 2024

КОМЕНТАРІ • 450

  • @LucidProgramming
    @LucidProgramming  6 років тому +106

    Note that @26:30 I call the "inorder" traversal function inside of the "postorder" traversal function and neglected to change it to postorder. This was a copy-paste error. You can fix it by changing the "inorder" call in postorder to the appropriate postorder call. Sorry for the mistake, and thanks for watching!

    • @Soccercrazyigboman
      @Soccercrazyigboman 6 років тому

      How can you go from child back to parent if you don't have a next and previous pointer?

    • @Soccercrazyigboman
      @Soccercrazyigboman 6 років тому

      By next and previous I should say if each node doesnt have a pointer pointing to the one above it as well as to the one below it?

    • @AshwaniKumar-dj6re
      @AshwaniKumar-dj6re 5 років тому

      @@Soccercrazyigboman he is using recursion

    • @NicholasSilva1380
      @NicholasSilva1380 5 років тому +41

      That changes the expected output from 4-2-5-6-3-7-1- to 4-5-2-6-7-3-1-

    • @violetkimani3118
      @violetkimani3118 5 років тому

      Hi, would be more efficient to add a function from within the class for adding values to the tree? does it help/ would it be more efficient especially during interviews

  • @bijayamanandhar3890
    @bijayamanandhar3890 5 років тому +19

    Thank you for the great tutorial! I am a new developer still looking for a job after graduation from a boot camp. I never had a chance to learn the data-structure, dfs, bfs etc before. Now, it's getting clear to me step by step after watching the videos you posted.

    • @LucidProgramming
      @LucidProgramming  5 років тому +2

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link
      paypal.me/VincentRusso1
      for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @edgarlip2
    @edgarlip2 4 роки тому +4

    wow - it is awesome !!!
    i can tell one analogy that helped me a lot : when do i collect the value :
    • pre-order - when value collected ?: once I am hovering on a node I am collecting it's value.
    • in-order - when value collected ?: if the node has no left node or the left node is already visited then add this value.
    • post-order - when value collected ?: once the node has no left nor right or left and right has been already visited then I will collect the value.
    HTH

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Thanks, and yes that's a great way to remember them!

  • @turjo119
    @turjo119 4 роки тому +10

    I was stuck for hours trying to understand this, you made it so simple! Thank you so much

    • @LucidProgramming
      @LucidProgramming  4 роки тому +3

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

    • @turjo119
      @turjo119 4 роки тому +2

      @@LucidProgramming Done and done my good man!

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      @@turjo119 Cheers, thank you!

  • @safderaree
    @safderaree 5 років тому +6

    Hands down the best explanation, I've struggled for so long trying to get the intuition through my textbook. Thanks!

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support. I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

    • @safderaree
      @safderaree 5 років тому +1

      @@LucidProgramming Sure, I've subscribed and signed up for the mailing list. You've made my interviewing process so much smoother.

    • @LucidProgramming
      @LucidProgramming  5 років тому

      @@safderaree Awesome, that's really great to hear! :)

  • @rhythmsaparia8788
    @rhythmsaparia8788 5 років тому +5

    Your explanation to data structure concepts in python is THE best!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @muhammadsalisabdulsalam4016
    @muhammadsalisabdulsalam4016 5 років тому +2

    This is the most simplified video tutorial with good examples, the best I have seen so far. I got everything after watching this video only once. A lot of online tutorials are just too ambiguous and really confusing. Lucid you're the best for sure. Thanks a lot

    • @LucidProgramming
      @LucidProgramming  5 років тому +2

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

    • @muhammadsalisabdulsalam4016
      @muhammadsalisabdulsalam4016 5 років тому +1

      @@LucidProgramming Sure, I'm interested. But how do I subscribe to your mail list please?

    • @LucidProgramming
      @LucidProgramming  5 років тому +2

      @@muhammadsalisabdulsalam4016 Just follow the link here: bit.ly/lp_email
      :)

  • @wyllerdesousa1710
    @wyllerdesousa1710 Рік тому +1

    Nice introduction! Thanks to support the TI community.

  • @deojeetsarkar2006
    @deojeetsarkar2006 5 років тому +6

    Your videos deserve more views

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @CodeX-mhs
    @CodeX-mhs 8 місяців тому +1

    Extremely thankful to you sir.

    • @LucidProgramming
      @LucidProgramming  8 місяців тому +1

      Thank you for the kind words, glad the videos are useful for you!

    • @CodeX-mhs
      @CodeX-mhs 8 місяців тому

      @@LucidProgramming A very welcome sir. Please keep providing. The growth doesn’t justify ur quality. Keep it up sir.

  • @enkaibi2756
    @enkaibi2756 5 років тому +3

    Too excited to sleep now! I finally understand it! Best video on Traversal Algorithms explanation! Consider watching all your python video!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

    • @enkaibi2756
      @enkaibi2756 5 років тому +3

      @@LucidProgramming Just a tiny recommendation, on 17:06, it would be better to use self.root instead of tree .root. Keep going! !!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      @@enkaibi2756 Point well taken. Thanks for the comment! :)

  • @ПавелТаранов-э1ч
    @ПавелТаранов-э1ч 2 роки тому

    Большое спасибо за ваше видео)
    Это потрясающе, я посмотрел ваш Гайд по связным спискам и теперь я тут. Лучшие видео по этой теме!)

  • @nero9985
    @nero9985 3 роки тому

    Thank god I looked at the comments regarding the issue with the post order function, I spent a good 10 mins looking to see if I had the wrong implementation

  • @dmgisi
    @dmgisi 2 роки тому +3

    I appreciate the good video and clear explanation. With a little more editing and attention to detail, it can become more polished and will be excellent.

    • @LucidProgramming
      @LucidProgramming  2 роки тому

      Thank you! I hope that the videos on this channel keep getting progressively better. Thanks for watching!

  • @hassanfarah3501
    @hassanfarah3501 5 років тому +1

    God bless you Sir. I have been following your tutorials for a while and you are a LEGEND

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link www.paypal.me/VincentRusso1
      for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @bhaskarbhuyan30
    @bhaskarbhuyan30 5 років тому +4

    Very informative and easy-to-understand tutorial. Thank you for this incredible contribution to the enthusiasts and learners!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @chrisgoehl2745
    @chrisgoehl2745 5 років тому +5

    Great Video! Thank you for visualising and really emphasizing on the most basic aspects as this is something which I personally as a Beginner seem to struggle with!
    Keep up the good work it is really appreciated!

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Thanks, Chris! That feedback is really helpful for me and I will try to keep that in mind for future videos. Thanks again for watching and for the comment!

  • @Unknown_22-z8c
    @Unknown_22-z8c 2 роки тому +1

    very good video for those who want to pick the grasp of binary tree quickly

    • @LucidProgramming
      @LucidProgramming  2 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @bhuwansharmaa
    @bhuwansharmaa 4 роки тому +1

    Best Explanation
    recursion is bit confusing but following each step through example made it easy... Thanks

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Awesome, that's great to hear. Thanks for watching!

  • @reccartoon
    @reccartoon 6 років тому +2

    i really love the way you are explaining all these concepts in very effective manner thanks for this :)

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Hi Sarfaraz. Really appreciate that comment, that's very much appreciated! Thank you for watching, and I'm happy to hear this video was effective. Cheers!

  • @DanielGarcia-uq8yz
    @DanielGarcia-uq8yz 2 роки тому +1

    I'm only 3 min in but love the explanations. Thanks!

  • @jethrotalavera3314
    @jethrotalavera3314 3 роки тому +1

    Best video I've seen on this topic. Thank you!

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @ilanaizelman3993
    @ilanaizelman3993 3 роки тому +1

    Can't be explained better. Thank you!

    • @LucidProgramming
      @LucidProgramming  3 роки тому +1

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

    • @ilanaizelman3993
      @ilanaizelman3993 3 роки тому

      @@LucidProgramming Done! :)
      Are you during Mock Interviews?
      Or know someone who does?

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      @@ilanaizelman3993 Thank you, Ilan! Your support is very much appreciated! And yes, I do perform mock interviews, coaching, and consulting services for software-based job preparation. If you're interested in setting something up, you're free to reach out to me in the "About" section of my channel and we can coordinate from there if you like. Cheers, and best of luck in your preparation in any case!

  • @robn8656
    @robn8656 4 роки тому

    Just incase there's someone like me out there: I struggled forever to understand how this code and recursive data structures generally worked until I finally understood recursion. Al Sweigart has a great video on recursion but essentially recursive functions use a stack method to determine how the functions are called. the subsequent functions can't be called until the previous one has been removed from the stack. each number being appended to the string is that function being removed from the stack. So, counterintuitively, the string begins with one because it's the LAST METHOD to be cleared from the stack. All, the other methods cycle through the tree first, appending their value to the string. It sounds backwards, I know. I don't even know if I explained it well but you have to understand recursion to understand BST. Watch Sweigart's video.

  • @wikhan2002
    @wikhan2002 4 роки тому

    Awesome! Just Awesome! This is where I could navigate to learn such an important thing earlier.

  • @Rich65501
    @Rich65501 5 років тому +2

    Beautiful presentation.

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @hemesh5663
    @hemesh5663 3 роки тому +1

    Dude you earned a subscriber and a fan

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      Thank you, man! Sincerely appreciate the support and love! Cheers!

  • @faithnwokoma
    @faithnwokoma 3 роки тому

    def postorder_print(self, start, traversal):
    #Left -> Right -> Root
    if start:
    traversal = self.postorder_print(start.left, traversal)
    traversal = self.postorder_print(start.right, traversal)
    traversal += (str(start.value) + "-")

    return traversal

  • @musclecode3771
    @musclecode3771 4 роки тому +1

    Amazing explanation well worth the time to watch.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. I hope to be putting out more similar videos soon!

  • @bronik7
    @bronik7 2 роки тому

    (17:57) Why in preorder_print (line 4) you passing tree.root? why not self.root? to me it's not clear how Class knows about it's instance?
    Can you please explain?
    Thank you

  • @vishnukumavat7489
    @vishnukumavat7489 4 роки тому +1

    Thanks for such a cool implementation explanation.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. I hope to be putting out more similar videos soon!

  • @gargoth
    @gargoth 5 років тому +1

    great video! i would suggest matching the colors of the slides to the colors of the editor, because the sudden switch from dark to light doesn't sit well while watching. thanks!

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      Thanks for the feedback, that's very helpful to know! Thanks again for watching as well!

    • @gargoth
      @gargoth 5 років тому +1

      no problem dude, i really appreciate your videos!

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      @@gargoth Cheers, thank you!

  • @jayaramakapil5295
    @jayaramakapil5295 5 років тому +20

    All Superheroes don't Wear Capes. Some wear Suit too :)

    • @LucidProgramming
      @LucidProgramming  5 років тому +4

      Haha, well I hope the videos are helpful to you. Cheers, and thanks for watching!

  • @kl-je3up
    @kl-je3up 2 роки тому +1

    explains it way better than my ds&a textbook lol

    • @LucidProgramming
      @LucidProgramming  2 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @hussainaqeel7371
    @hussainaqeel7371 3 роки тому +1

    Great Stuff! Made it very easy to understand! Thanks!

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

    • @hussainaqeel7371
      @hussainaqeel7371 3 роки тому

      @@LucidProgramming sure!

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      @@hussainaqeel7371 Cheers, thank you!

  • @cdemr
    @cdemr 2 роки тому +1

    I am on Pycharm and I am a beginner. I do not understand what you're doing at 18:15.
    I can force-erase the consol but I can't write inside it.

  • @hoangphuoccao117
    @hoangphuoccao117 3 роки тому +1

    Great explanations! Thank you very much!!

    • @LucidProgramming
      @LucidProgramming  3 роки тому +1

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @supamdeepbains5172
    @supamdeepbains5172 6 років тому +1

    best explanation on youtube!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Haha, cheers Spamdeep, I really appreciate that :). Happy coding, and thanks for the kind comment!

    • @ravitanwar9537
      @ravitanwar9537 6 років тому

      @@LucidProgramming actually the name is supamdeep not spamdeep

    • @LucidProgramming
      @LucidProgramming  6 років тому

      @@ravitanwar9537 Whoops. Must have been my autocorrect? Sorry about that. Thanks for catching, Ravi.

  • @SaltAndVi
    @SaltAndVi 4 роки тому +1

    phenomenal video, thank you so much!!!

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @theguildedcage
    @theguildedcage 6 років тому +2

    Awesome tutorial! Thanks.

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Thank you, Philip! I'm glad you found the tutorial useful! Cheers, and thanks again for watching.

  • @toderickson6106
    @toderickson6106 2 роки тому +1

    good clarification skills, gave it a like

  • @zarioiubogdan1164
    @zarioiubogdan1164 4 роки тому +1

    Hi there!
    Thank you so much for this! I just discovered your videos and they are so helpful! I was struggling a lot to understand how I could implement and traverse a binary tree. There are countless videos about this but yours really made me understand and gave me hope that with time and practice I could learn these concepts.
    I saw you have videos on many data structures and I plan to go through all of them and try to understand. Could you please also cover graph implementation and traversal in Python?
    Thank you again for your help!
    Wish you the best!

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      You can feel free to make suggestions on my Patreon page. This would streamline what you want to see and also help to support my channel.
      www.patreon.com/lucidprogramming

  • @felipepardosuarez2364
    @felipepardosuarez2364 5 років тому +2

    Great video. Thank you!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support. I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @vnpikachu4627
    @vnpikachu4627 6 років тому +1

    Great work very easy to understand i really appreciate what you are doing to help us

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Hey Huru. Thank you very much for that comment. It's really great to hear that these videos have been helpful to you. I really get a lot of enjoyment from doing so as well, so the benefit is mutual! Cheers and thanks again for watching.

    • @vnpikachu4627
      @vnpikachu4627 6 років тому +1

      Just 30 minutes i go from nothing to understand a lot more about tree could you please make a tutorial about graph and some algorithm about tree ?

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Really happy to hear that. Yes, graphs are most certainly coming up soon! Thanks for the suggestion and for the comment!

  • @Me-ex7qg
    @Me-ex7qg 6 років тому +1

    wish i found your channel earlier. very good

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Thanks, TJ. I'm happy you stumbled on it now, and I hope the videos serve you well! Thanks for the comment, and happy coding!

  • @cryptoTeacherAcademey
    @cryptoTeacherAcademey 5 років тому +1

    Thank you so much for the great tutorial!!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing! I really appreciate the support. I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @ramiz3570
    @ramiz3570 5 років тому +1

    Amazing explanation, thanks!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @olivierbegassat851
    @olivierbegassat851 4 роки тому +1

    Very valuable explanation! Thanks : )

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Glad to hear it, and thanks for watching! :)

    • @olivierbegassat851
      @olivierbegassat851 4 роки тому

      ​@@LucidProgramming The preorder_print function is the sort of thing I would have had a hard time coming up with myself. My naïve attempt would have been to have some list or dictionary of nodes whose left child you've already visited ... instead you simply wrote (amongst other things I'm skipping)
      traversal = self.preorder_print(start.left, traversal)
      traversal = self.preorder_print(start.right, traversal)
      This is really interesting, it's orders of magnitude more elegant and succinct. I wouldn't have come up with it. I would have written some longwinded solution using an extra list or dictionary.
      Do you know a book or online resource that contains Python implementations of many standard data structures ?

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@olivierbegassat851 Thanks for the comment. Honestly, you can probably just Google for Python data structures and find something reasonably good.

  • @nx8221
    @nx8221 5 років тому +3

    Dude thank you for this!

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @rohith8269
    @rohith8269 3 роки тому +1

    great explanation!!

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @gunabalang7034
    @gunabalang7034 4 роки тому +1

    crystal clear

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @DavidKaplanProgramming
    @DavidKaplanProgramming 6 років тому +1

    Really good tutorial man! Thanks

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Thank you, David, I'm very happy to hear that you enjoyed the tutorial! Cheers.

  • @cudanakiju0
    @cudanakiju0 3 роки тому +2

    @17:04 you type tree.root, shouldn't that be self.root instead?

    • @bronik7
      @bronik7 2 роки тому +1

      That's what I thought. It's not clear to me how object will know it's instance

  • @HanisaMohamed
    @HanisaMohamed 4 роки тому +1

    Thank you! Explained it very well.

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @kionlingg
    @kionlingg 5 років тому

    For the output on 19:38 I received an output "Traversal type preorder is not supported." Is that the correct output? Am I missing something?

    • @LucidProgramming
      @LucidProgramming  5 років тому

      You should check your code against mine on GitHub.

  • @hackytech7494
    @hackytech7494 4 роки тому +3

    Thank you so much for your explanation it was wonderful. I am having one doubt we haven't coded to go up if we don't have left or right children, then how it goes up programaticaly

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Hi Tammay. Thanks for the comment. You might want to check out my recursion playlist if that part is tripping you up. I think it clarifies your confusion. Cheers!

    • @hackytech7494
      @hackytech7494 4 роки тому +1

      @@LucidProgramming Ok Thank you so much sir. I will go through that playlist first.

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      @@hackytech7494 Cheers!

  • @alexradu1921
    @alexradu1921 4 роки тому

    I've implemented the traversion with a list version, to be more useful... and also I've modified the print function not to return the list, and just directly print it (because, it's called "print_tree")...
    class BinaryTree:
    def __init__(self, root):
    self.root = Node(root)
    def print_tree(self, traversal_type):
    if traversal_type == "preorder":
    print(self.preorder_list(self.root, []))
    elif traversal_type == "inorder":
    print(self.inorder_list(self.root, []))
    elif traversal_type == "postorder":
    print(self.postorder_list(self.root, []))
    def preorder_list(self, start, traversal):
    ''' Root->Left->Right '''
    # start = node update on every recursive call
    # traversal = list with values of tree in preorder
    if start:
    traversal.append(start.value)
    traversal = self.preorder_list(start.left, traversal)
    traversal = self.preorder_list(start.right, traversal)
    return traversal
    def inorder_list(self, start, traversal):
    ''' Left->Root->Right '''
    if start:
    traversal = self.inorder_list(start.left, traversal)
    traversal.append(start.value)
    traversal = self.inorder_list(start.right, traversal)
    return traversal
    def postorder_list(self, start, traversal):
    ''' Left->Right->Root '''
    if start:
    traversal = self.postorder_list(start.left, traversal)
    traversal = self.postorder_list(start.right, traversal)
    traversal.append(start.value)
    return traversal
    tree = BinaryTree(1)
    tree.root.left = Node(2)
    tree.root.right = Node(3)
    tree.root.left.left = Node(4)
    tree.root.left.right = Node(5)
    tree.root.right.left = Node(6)
    tree.root.right.right = Node(7)
    print(tree.preorder_list(tree.root, []))
    #you can print the llist directly
    tree.print_tree("preorder")
    tree.print_tree("inorder")
    tree.print_tree("postorder")

    • @alexradu1921
      @alexradu1921 4 роки тому

      ALSO *Thank you* for this very well explained video on trees using python... If i search the Internet for a Binary Tree in Python I found just very complicated unnecesary syntax.

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Cool, thanks for sharing!

  • @drcylon
    @drcylon 3 роки тому

    I think there is a little error in the "print_tree()" function, it shouldn't be "tree.root" it should be "self.root" ! Plus the "postorder" error pointed out in some comments below!
    Still, it is a great effort. Thanks.

  • @nivi8319
    @nivi8319 4 роки тому

    @19:30 i don't know if my doubt sounds silly but I want to know how it is moved upward when there is no left or right subtree
    I didn't get that
    please can you explain??
    and thank you for this amazing video : )

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Thanks, Nivi. I think you might benefit from checking out my recursion playlist as that might clear this up. Hope that helps!

    • @nivi8319
      @nivi8319 4 роки тому +1

      @@LucidProgramming ohh thanks a lot , I'll check that

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@nivi8319 Cheers, let me know if you have questions!

  • @kshitijtewari2025
    @kshitijtewari2025 5 років тому +13

    Thanks Sir, what is difference b/w class Node(object): and class Node:

    • @LucidProgramming
      @LucidProgramming  5 років тому +5

      No difference at all!

    • @amithpandit4043
      @amithpandit4043 5 років тому +2

      That's right. No difference. According to the link below: in Python 2.7 and older, you need to add the object inside parenthesis. In Python 3 and above, it doesn't make a difference.
      introtopython.org/classes.html

    • @abhinavreddy5350
      @abhinavreddy5350 4 роки тому

      @@amithpandit4043 kk tq :)

  • @TechArtGenius
    @TechArtGenius 3 місяці тому

    The height and depth concept..I think the depth at the root node is depth 0 and increases by 1 as you go down the tree. And this is the opposite for the heights. But looks like you started counting at 1 instead of 0.

  • @hakankanplay
    @hakankanplay 6 років тому

    can you explain @19:33 when you call return tranversal, why it returns you the previous node of the current node that has empty left and right childs?

    • @LucidProgramming
      @LucidProgramming  6 років тому +1

      Hi Hakan. Sure, the reason for this is because as we hit the base case of the function, we start working back through the stack frame from all the previous recursive calls to the function. I would recommend you print out the output as these calls are being made to see when and where they happen. I think seeing that can be helpful. Hope that makes sense, and thanks for watching!

  • @rohitashpathak260
    @rohitashpathak260 4 роки тому +1

    I started learning python data structure only after watching your videos. Thank you so much.
    Do you have some projects in python that can we can go through, it will help to build the overall confidence level in coding.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Great to hear.
      As for projects, I offer tutoring. You can reach out to my email and I can provide you rates and ideas. Cheers!

    • @rohitashpathak260
      @rohitashpathak260 4 роки тому

      LucidProgramming Thanks for your response but if you have some free contents that you can share will be a great help.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@rohitashpathak260 Due to time constraints, I may have to back away. I can suggest the other content on my UA-cam channel, though!

  • @MomoDiff48
    @MomoDiff48 2 роки тому +1

    Just a small question, is it necessary to make whole class BinaryTree just for the root node? or it has something to do with python versions?

  • @neildutoit5177
    @neildutoit5177 3 роки тому

    checking for None using a bool cast is also an anti-pattern. Use "if start is not None" instead.

  • @valentynsson5969
    @valentynsson5969 4 роки тому +2

    Legend perfect explanation thank´s I like it.

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link
      paypal.me/VincentRusso1
      for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @ajayprajapati2453
    @ajayprajapati2453 4 роки тому

    Hi..Thank you so much for uploading video with nice explanation..

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Cheers! If you found the video helpful, I would definitely appreciate any a like/subscribe/share! Thanks for watching!

  • @khavishbhundoo3792
    @khavishbhundoo3792 6 років тому +1

    Could you include the link for the presentation as well.It serves as a quick recap.Thanks for the great explanation.

    • @LucidProgramming
      @LucidProgramming  6 років тому +1

      At the moment, those slides are a bit all over the place. However, it would certainly not be an issue to clean them up and post a link in the description of this video. Might take me a while to get around to it, but I'll add it to the list. Thanks for the suggestion and thanks for watching! :)

  • @ninjaturtle205
    @ninjaturtle205 2 роки тому

    in postorder definiition you recursively called inorder. (i think you forgot to update after copy pasting)
    The answerjjjjj should be
    4-5-2-6-7-3-1-
    excellent video. i understood everything

    • @LucidProgramming
      @LucidProgramming  2 роки тому

      Thank you! And indeed, I pinned a comment that explains this discrepancy. Good catch in any case!

  • @raakobihai2967
    @raakobihai2967 4 роки тому +1

    Thank you soo much for this!

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @gokusaiyan1128
    @gokusaiyan1128 2 роки тому +1

    What are your vim settings/plugins? I like it

    • @LucidProgramming
      @LucidProgramming  2 роки тому +1

      Good question! Much of my configuration is covered here: ua-cam.com/video/vlb3qUiS2ZY/v-deo.html

  • @ishannoying
    @ishannoying 5 років тому +2

    loved it!

    • @LucidProgramming
      @LucidProgramming  5 років тому

      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link (www.paypal.me/VincentRusso1) for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @someshsangwan3768
    @someshsangwan3768 3 роки тому +1

    Thnq sir I am facing a TypeError: Binary tree takes no argument .
    Tell me about this

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      You might want to check your code against my GitHub code.

  • @Mcbridefam20129
    @Mcbridefam20129 4 роки тому +2

    Hi, thank you so much for the video. I am a little confused still about one thing. When in the preorder traversal, when it comes to a leaf that dosn't have a left or right node, in the code how does it go backwards to the previous node or back to the root?

    • @LucidProgramming
      @LucidProgramming  4 роки тому +3

      I would encourage you to check out my playlist on recursion, as it seems you have a gap in understanding how recursive calls are treated.

  • @conquerworld_in
    @conquerworld_in 4 роки тому

    Hello sir,
    I am not able to understand that how everything is happening here as in if how are we writing start.value with inheritance and those things!

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      You might want to look into Python classes to clarify this.

    • @conquerworld_in
      @conquerworld_in 4 роки тому

      @@LucidProgramming I saw that but then also I wasn't able to understand

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      @@conquerworld_in You might need to be more specific. I offer tutoring services if you feel like you're stuck on a subject.

  • @yashpandey350
    @yashpandey350 4 роки тому +3

    Sir in each order_print functions how node gets back to head position when its left child or right child becomes None.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Through the recursive call of the function (if I understand the question correctly).

    • @ajrvasu
      @ajrvasu 4 роки тому

      @@LucidProgramming Thanks for the great set of videos. My go to playlists.
      On this one - a bit confused as to how the recursion is getting back to the right child. In the example, after reaching 4, the left child is none. So the recursive function should not enter the loop at all, so how is reading the right child (5)? I get the code intuitively, but am stuck when trying to create the stack line by line to understand the recursion well.

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      @@ajrvasu I think what might be insightful is to print out the elements as you make the recursive calls. That might make it a bit clearer as to what is happening. Hope that helps!

    • @ajrvasu
      @ajrvasu 4 роки тому +1

      @@LucidProgramming Thanks for the suggestion.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@ajrvasu No problem, cheers!

  • @samkruse6242
    @samkruse6242 6 років тому +1

    This is gold

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Thanks, Sam! I'm glad that this video was useful to you. Thanks for the comment and for watching! Cheers.

  • @jingfenghong2312
    @jingfenghong2312 5 років тому +2

    These are awesome videos I have ever seen. I have a question, why don't you use self.root in print_tree() function, but use tree.root?

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      Thanks! And either convention is fine there. Using self.root would work just as well. Cheers!

    • @jingfenghong2312
      @jingfenghong2312 5 років тому +1

      @@LucidProgramming Thank you a lot, these videos would definitely help me in my future career interview! I will recommend it to other friends.

    • @LucidProgramming
      @LucidProgramming  5 років тому

      @@jingfenghong2312 Thank you, I sincerely appreciate that!

  • @Mankind5490
    @Mankind5490 2 роки тому +1

    This is fantastic, thank you

    • @LucidProgramming
      @LucidProgramming  2 роки тому +1

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

    • @Mankind5490
      @Mankind5490 2 роки тому

      @@LucidProgramming Already done!

  • @VarunKumar-pz5si
    @VarunKumar-pz5si 4 роки тому +1

    Can you explain the recursion in pre-order traversal?

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Got a whole playlist on recursion you can check out!

  • @rhythmsaparia8788
    @rhythmsaparia8788 5 років тому +1

    I have a doubt, after a while adding nodes by writing tree.root.left.right.left bla bla becomes a cumbersome process, if you could suggest a better and easier way to add nodes than it would be a great help, thanks.

  • @kowyo
    @kowyo 7 місяців тому

    Thank you for this video

  • @ГоранДеспотовић

    Thank you sir!

    • @LucidProgramming
      @LucidProgramming  Рік тому +1

      You're very welcome. Thank you for watching!

    • @ГоранДеспотовић
      @ГоранДеспотовић Рік тому +1

      @@LucidProgramming I watched many videos on this subject, yours is spot on!
      You're a great teacher, thanks again!

    • @LucidProgramming
      @LucidProgramming  Рік тому +1

      @@ГоранДеспотовић thank you for the kind words!

  • @zewdiherring9528
    @zewdiherring9528 2 роки тому +1

    Thanks! Helpful :D

    • @LucidProgramming
      @LucidProgramming  2 роки тому

      Thank you for watching, and glad to hear that it was helpful!

  • @alessiopellegrini523
    @alessiopellegrini523 6 місяців тому

    Shouldn't it be self.preorder_print(self.root, " ") in the helper function of the BinaryTree? There is no tree variable in the class and the only way the code is still running correctly is because "tree" happens to be defined outside of class, no?

  • @raheemwilliams7998
    @raheemwilliams7998 4 роки тому

    how are you able to access attributes from another class without creating an object for it or even using inheritance? plz explain

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      I think you might need to look into object oriented design on your own. I'm not going to give you a lecture on OOP principles in a UA-cam comment.

  • @Iamnoone56
    @Iamnoone56 4 роки тому +1

    Please make videos on graph and please add more questions on trees 😭😭

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      You can feel free to make suggestions on my Patreon page. This would streamline what you want to see and also help to support my channel.
      www.patreon.com/lucidprogramming

  • @karinah6762
    @karinah6762 4 роки тому

    Hi, why when you define the node class or binary class it inherits from object class?

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      This is the way in which you define a class in Python.

  • @prathamgupta7605
    @prathamgupta7605 4 роки тому

    Just wanted to know how does it know to go back ie., (Upwards) (19:12)

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      We are making recursive calls to the function. If this is hard to follow, I would encourage you to check out my recursion playlist here:
      bit.ly/lp_recursion
      Cheers!

  • @redpred3502
    @redpred3502 4 роки тому

    For the functions being returned in the print_tree method, what difference would it make if self.root was used as arguments instead of tree.root? Doesn't tree.root limit the class to just that object?

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Have you tried doing that?

    • @redpred3502
      @redpred3502 4 роки тому

      @@LucidProgramming I did and now it works with different named trees.

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@redpred3502 Right, because "self" and "tree" both refer to an instance of the Tree class.

    • @ZhuYiting612
      @ZhuYiting612 4 роки тому

      @@LucidProgramming and by using "self.root" can make the function works for an instance with any name other than the name "tree", right? thanks

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@ZhuYiting612 So long as you're referring to the object created in the class.

  • @test-y1p7r
    @test-y1p7r 2 роки тому

    If I'm not mistaken, depth of root node is 0. Root node is at level 0, not 1 :)

  • @user-vj3fs4cq9n
    @user-vj3fs4cq9n Рік тому

    amazing video

  • @ayushisingh6638
    @ayushisingh6638 4 роки тому

    I didn't get that in Inorder traversal like how from node A it's Going back to Node B?

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      You might want to check out my playlist on recursion if this part is confusing to you.

  • @minaliaggarwal
    @minaliaggarwal 6 років тому +3

    Hi- I think the code for post-order traversal might be incorrect.
    Is it supposed to output: [4, 5, 2, 6, 7, 3, 1]? Saw a similar tree in this article with this as the output: www.geeksforgeeks.org/iterative-postorder-traversal-using-stack/

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Hi Minali. You are absolutely correct. I checked to make sure the other traversals are correct, and they appear to be. As you say though, there seems to be something incorrect about the post-order traversal. I will be updating the code and also adding a note to the video to ensure others are aware of this. Thank you very much for pointing out my error, I sincerely appreciate this as it improves the quality of the content on this channel. Cheers, and thank you again.

    • @minaliaggarwal
      @minaliaggarwal 6 років тому

      No problem! Thanks for fixing it!

    • @LucidProgramming
      @LucidProgramming  6 років тому

      Ah actually, I believe my issue here was I was calling the "inorder" function inside of the "postorder" function. Another helpful commenter pointed this out and I have since fixed the code. D'oh! :) Thanks again for letting me know, and thanks for your help!

  • @vitaliano01
    @vitaliano01 3 роки тому +1

    Thank you.

    • @LucidProgramming
      @LucidProgramming  3 роки тому

      Cheers! If you enjoyed and benefited from my content, please consider liking the video and subscribing to the channel for more content like this. If you would like to support the content creation on this channel please consider unblocking ads when watching my videos as this is how I support my time to make content. I hope to be putting out more similar videos soon!

  • @kzr_567
    @kzr_567 4 роки тому

    in pre order, the traversal variable is updating in the first line, why did you put traversal = self.preorder(self,left,traversal) , cant we just call the function recursively

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      Sure, you could do it recursively.

    • @kzr_567
      @kzr_567 4 роки тому

      @@LucidProgramming when i remove the recieving traversal variable from the two lines, the traversal variable doesnt get updated. It only shows me '1-' thats it
      what i mean is
      traversal += ..
      self.preorder(self,start.left,traversal)
      self.preorder(self,start.right,traversal)
      instead of
      traversal += ..
      traversal = self..
      traversal = self..

    • @LucidProgramming
      @LucidProgramming  4 роки тому

      @@kzr_567 Not sure I understand. The way in which the video conveys this concept is done so recursively.

  • @michaelscarn7375
    @michaelscarn7375 5 років тому

    I don't get why the program doesn't stop and return "traversal" string in preorder as soon as it reaches left most node ( 4 in your example). There is no left or right child node at 4. What makes it to go up back to 2.

    • @LucidProgramming
      @LucidProgramming  5 років тому

      I think the confusion here might be arising from understanding how recursion is being used. If that is the case, I do have a playlist on recursion that might clear some of this confusion up. Thanks again for watching!

    • @michaelscarn7375
      @michaelscarn7375 5 років тому

      @@LucidProgramming I got it now, thanks to Your other video on tree traversal, where you went through entire funtion run. Glad I found Your channel. You along with Corey Schafer among my top youtube coding tutors. Wish you All the Best.

    • @LucidProgramming
      @LucidProgramming  5 років тому

      @@michaelscarn7375 Corey Schafer is great. Very flattering of you to put us in the same camp. Cheers, and thanks again for watching!

    • @MsKshitij1234
      @MsKshitij1234 4 роки тому

      @@michaelscarn7375 which video is it, I am still stuck with this probelm not able to understand the flow

  • @musictrader8990
    @musictrader8990 4 роки тому

    What is the "object" argument you pass when creating class?

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      It's legacy Python. You can do either class Name: or class Name(object):

  • @shivamdubey9225
    @shivamdubey9225 5 років тому +2

    Please make videos on bfs and dfs and some of its important use , in python it is hard to find on utube

    • @LucidProgramming
      @LucidProgramming  5 років тому

      It's on my list of videos to make! Subscribe and stay tuned!

    • @debashishchakraborty7924
      @debashishchakraborty7924 5 років тому

      @@LucidProgramming ..you are not making new videos, no one can explain python data structures better than you. please do something....

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      @@debashishchakraborty7924 Lots of balls up in the air at the moment. Right now, I'm putting together a book that I hope to have video content for. Stay tuned!

    • @vnaveenkumar982
      @vnaveenkumar982 5 років тому +1

      @@LucidProgramming Thanks for the tutorial... please make such videos in python about data structures and you explain it like a pro please continue..

    • @LucidProgramming
      @LucidProgramming  5 років тому +1

      @@vnaveenkumar982
      Thank you! If you like my content, I've been working on some projects during the past couple of months. If you would like to stay up-to-date, please consider subscribing to my mail list. Also, if you haven't already, please consider subscribing!
      I really appreciate the support, and if you want to support the channel, I do have a PayPal link
      paypal.me/VincentRusso1
      for donations that go directly to the creation of content on this channel.
      I hope that the content I provide there will enhance the videos on my UA-cam page.
      bit.ly/lp_email

  • @valeriasalas4700
    @valeriasalas4700 4 роки тому

    Hello, great video. What if I wanted to create a nested list that represented the tree?

    • @LucidProgramming
      @LucidProgramming  4 роки тому +1

      Thanks. I'm not sure how to answer the question. It's kind of like asking "how can I loop over the elements in the tree"? Well, you just use a for loop to do so.