Тёмный

Binary Trees in Python: Level-order Traversal 

LucidProgramming
Подписаться 43 тыс.
Просмотров 35 тыс.
50% 1

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

 

9 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 137   
@rajeyshkumar
@rajeyshkumar 4 года назад
Appreciate your coding fluency and teaching skills
@LucidProgramming
@LucidProgramming 4 года назад
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 RU-vid page. bit.ly/lp_email
@samarasimhachalla3509
@samarasimhachalla3509 3 года назад
If you are watching his content and learning from it, you better subscribe !! Do it right now !! This guy is a legend
@LucidProgramming
@LucidProgramming 3 года назад
Cheers, thanks! :)
@TheArun11143
@TheArun11143 4 года назад
Using list instead of Queue ;) def levelorder(root): Queue=[ ] if root is None: return else: Queue.append(root) while(Queue!=[ ]): curr=Queue[0] if(curr.left): Queue.append(curr.left) if(curr.right): Queue.append(curr.right) print(curr.data) Queue.pop(0) PS: That was a great explanation.. thank you!!
@LucidProgramming
@LucidProgramming 4 года назад
Cool, thanks for sharing!
@jonarmani8654
@jonarmani8654 4 года назад
Yo man the level-order algorithm blows my mind.
@LucidProgramming
@LucidProgramming 4 года назад
Haha, it's quite neat! :)
@0161rt
@0161rt 5 лет назад
As ppl's comments on the Queue FIFO(first in first out), I finally under stand your logic of using .insert(0, item) for enqueue and .pop(-1) for the dequeue. But I still prefer the sequence of .insert(len(self.items),item) for enqueue and .pop(0) for dequeue. It seems more straight forward following the python index. Albeit that this is probably not as clean on the coding script.
@LucidProgramming
@LucidProgramming 5 лет назад
Definitely understand the point you're making and I can see why your approach is clearer, especially from the standpoint of the implementation of the Queue data structure. Thanks for sharing and for watching! :)
@tedarcher9120
@tedarcher9120 3 года назад
Never use List as a queue. It takes 0(1) to put an element in the back, but 0(N) to pop(0) or in reverse to put an element in front in takes 0(N). You slow down your program by thousands of times on a big dataset, use collections deque, it's included in all python
@tedarcher9120
@tedarcher9120 3 года назад
Using list as stack is ok though, if you put items and pop in the back of the list
@missngbrownie
@missngbrownie Год назад
Your technical communication skills are exceptional. Truly appreciate your videos!
@LucidProgramming
@LucidProgramming Год назад
Very kind of you to say, thank you for the kind words!
@icycold007
@icycold007 3 года назад
one of the best teacher on youtube no-cap
@LucidProgramming
@LucidProgramming 3 года назад
Sincerely appreciated. Thank you for your kind words!
@icycold007
@icycold007 3 года назад
@@LucidProgramming i would highly appreciate it if you could do a video on hashmaps , i am following your course on educative.io too
@LucidProgramming
@LucidProgramming 3 года назад
@@icycold007 My time these days has been sincerely limited, but I will try at some point in the future to do so!
@devanshsolani2593
@devanshsolani2593 4 года назад
Your videos are the reason why I feel now coding Is fun and interesting
@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!
@hamzamusse7853
@hamzamusse7853 4 года назад
What a simple, beautiful explanation! THANK YOU!!
@LucidProgramming
@LucidProgramming 4 года назад
Thank you for watching! :)
@akshaykhadka9440
@akshaykhadka9440 4 года назад
An effective way to precisely define the Queue class ! Thank you for providing the quality videos .
@LucidProgramming
@LucidProgramming 4 года назад
Thanks, and thank you for watching!
@Magmatic91
@Magmatic91 3 года назад
Hi Mr.Lucid, your content is really one of a kind. This channel definitely deserves more views and attention. Your way of explaining is great and you obviously master your stuff.
@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!
@ZSDxGaming
@ZSDxGaming 3 года назад
Loved the way you code. Very clear and crisp. Easy to understand. Thanks a lot man
@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!
@derrick7968
@derrick7968 3 года назад
Thanks sir for explanation. I changed the function just using lists instead of Queue class, I use append to enqueue and pop(0) to dequeue. Here is the function. #Tree 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) # tree.root.right.right.right = Node(8) def level_search(self): queue = [] final = [] queue.append(self.root) while len(queue) > 0: final.append(queue[0].value) elem = queue.pop(0) if elem.left: queue.append(elem.left) if elem.right: queue.append(elem.right) return final #final >>> [1, 2, 3, 4, 5, 6, 7, 8]
@LucidProgramming
@LucidProgramming 3 года назад
Cool, that's definitely one way to do it. Thanks for sharing!
@derrick7968
@derrick7968 3 года назад
@@LucidProgramming could you do zigzag traversal please. Someone suggested to me to use two stacks.
@LucidProgramming
@LucidProgramming 3 года назад
@@derrick7968 Sure you could. Go for it.
@derrick7968
@derrick7968 3 года назад
Oh, ok let me try, where can I reach out to you. LinkedIn or email.
@LucidProgramming
@LucidProgramming 3 года назад
@@derrick7968 Comments is fine.
@yongguangqin3007
@yongguangqin3007 6 лет назад
The queue illustration in the slides was a bit confusing for me in the beginning. I understand now that either way would work, but based on the diagram I thought enqueue inserts an item at index -1 position (end of the python list), whereas dequeue pops the index 0 item. Otherwise very clear explanation, thank you for the great work!
@LucidProgramming
@LucidProgramming 6 лет назад
Hey Yongguang. Indeed, perhaps the diagram in the slides portion could have been a bit more explicit, but it sounds like you got the general gist of it. Thanks for the comment, I definitely try to factor these sorts of things into future videos as I want to attempt to be as clear as possible. Thanks for watching, and happy coding!
@rushilkumar9609
@rushilkumar9609 4 года назад
In that case enqueue will append the item and for dequeue u need to pop 0th element everytime
@bailymartin4305
@bailymartin4305 3 года назад
This saved me so much stress. 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!
@davidrowlands8548
@davidrowlands8548 2 года назад
Yet another excellent video. Thank you.
@alexandraxu4007
@alexandraxu4007 3 года назад
really love your data structure courses, the best that I have found, and I went through a loooot. 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!
@percyjackson1662
@percyjackson1662 11 месяцев назад
Such a great content! Can we have more such videos, especially like a DSA interview questions series?
@LucidProgramming
@LucidProgramming 11 месяцев назад
I would love to make more, but time for me is a rare commodity these days. Thank you for watching though!
@sebastianandrade8500
@sebastianandrade8500 3 года назад
Awesome 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!
@nishantbanjade920
@nishantbanjade920 4 года назад
Thank you so much sir
@LucidProgramming
@LucidProgramming 4 года назад
Thank you very much for your kind words and for watching. Cheers!
@alexdarcovich9349
@alexdarcovich9349 5 лет назад
Very well explained! Thank you so much!
@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 RU-vid page. bit.ly/lp_email
@sonnychiba5270
@sonnychiba5270 5 лет назад
Nice video, I think the somewhat confusing part was that the visual drawing of the list showed values/nodes being appended to the end of the list and later dequeued from the front, but the code inserts values/nodes at the beginning and then peeks & pops them from the end. That's the impression I got, but anyways, great video series!
@LucidProgramming
@LucidProgramming 5 лет назад
Thank you for watching, and nice point! It's great to get this type of constructive feedback. Thanks for watching, and for the comment!
@sagardhampalwar
@sagardhampalwar 4 года назад
Here is simple solution with less lines of code: hope u like this def levelOrder(self): traversal = "" l= list() t = self.root l.append(t) while(len(l)!=0): traversal += (str(l[0].data) + " ") if l[0].left: l.append(l[0].left) if l[0].right: l.append(l[0].right) l.remove(l[0]) return traversal
@mohamadkanafani5979
@mohamadkanafani5979 3 года назад
Hi , your explanation goes beyond perfect , even i am not a computer scientist student, but your explanation makes me love the data structures and coding :) i want to ask you something, why you stopped making tutorials? and is there any tutorials on graphs?
@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!
@iamcodemaker
@iamcodemaker 4 года назад
Thanks for sharing this content!
@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!
@nisargbhatt4967
@nisargbhatt4967 2 месяца назад
why does the enqeueue method insert an element at first index of the list? isn't a queue FIFO?
@cliffordbamert7728
@cliffordbamert7728 2 года назад
thanks
@LucidProgramming
@LucidProgramming 2 года назад
Of course, thank you for watching!
@thedevsaddam
@thedevsaddam 4 года назад
I really appreciate your effort. Why there is no video on heap, priority queue
@LucidProgramming
@LucidProgramming 4 года назад
Thanks! And to answer your question, it's because I do not have the time :P
@ashishgoyal4958
@ashishgoyal4958 5 лет назад
Please tell why this error this coming: while len(queue) > 0: TypeError: object of type 'Queue' has no len()
@LucidProgramming
@LucidProgramming 5 лет назад
I'm not seeing that. You sure you have the right code running?
@ravis7643
@ravis7643 4 года назад
This is really great :) Just one qn - Could you explain the reason for overwriting length function, when we have a built in method (len) for list data structure
@LucidProgramming
@LucidProgramming 4 года назад
Thanks. And yeah, the reason we overload it is because the built-in length function is not defined for arbitrary data structures like this. It works on strings, lists, etc. but how would Python know how length is defined for this if we don't explicitly tell it how to quantify it?
@ravis7643
@ravis7643 4 года назад
@@LucidProgramming Thanks for clarifying
@LucidProgramming
@LucidProgramming 4 года назад
@@ravis7643 Sure, hope that made sense!
@temitopeadeniji1249
@temitopeadeniji1249 Год назад
Hi LucidProgramming! I just came across your videos, they're very good. I have a question about def print_tree. Why did you use tree.root as the function argument e.g. return self.inorder_print(tree.root)? I'm new to this, shouldn't it be self.root instead?
@LucidProgramming
@LucidProgramming Год назад
Hi Temitope. Thank you for the kind words! And yes, you can indeed use `self` in this case for the same result. Cheers!
@temitopeadeniji1249
@temitopeadeniji1249 Год назад
@@LucidProgramming Thanks for the quick response. You're amazing!
@seungjaeyang1476
@seungjaeyang1476 4 года назад
I don't quite understand the "overriding" part at 11:40. Can someone please explain it to me?? Thanks!
@tanishktripathi217
@tanishktripathi217 3 года назад
Hello sir, amazing explanation I just had one doubt that why did you return items in sizeof()
@LucidProgramming
@LucidProgramming 3 года назад
Can you timestamp? Not sure where you're seeing this.
@kimber8324
@kimber8324 4 года назад
I had to watch the video twice to make sure I understood why we use a -1 index for the peek() function. Because of the nature of a queue, when you're inserting into the queue (enqueuing), you can use 0 index to add an element to the front of the queue... but when you're dequeuing an element, you have to "flip" the structure and use -1 as the index since a queue is "first in, first out". Essentially, the front becomes back. Does that make any sense at all? If so, is that the right way of thinking about it?
@LucidProgramming
@LucidProgramming 4 года назад
Yeah, I think that's a fine way to visualize it. A queue is like the queue in a shop where the first one in is the first one out, while a stack is based on being the first one in is the last one out; like a stack of plates at a buffet or a stack of pancakes.
@songshub_smitvavliya
@songshub_smitvavliya 4 года назад
def levelorder_traversal(self): arr = list() arr.append(self.root) traversal = "" while len(arr) > 0: if arr[:1][0].left: arr.append(arr[:1][0].left) if arr[:1][0].right: arr.append(arr[:1][0].right) traversal += str(arr[:1][0].data + " ") arr = arr[1:] return traversal
@LucidProgramming
@LucidProgramming 3 года назад
Cool, thanks for sharing!
@dhananjayravi8942
@dhananjayravi8942 11 месяцев назад
what software are you using for editing the code
@LucidProgramming
@LucidProgramming 11 месяцев назад
It's all mentioned in the description if you'd like more details. Cheers!
@jowadulkader9006
@jowadulkader9006 5 лет назад
sir,hi,you wrote if node.left: queue.enqueue(node.left) if node.right: queue.enqueue(node.right) isnt the enqueue function inserting nodes at position 0? so isnt there a clash?
@jowadulkader9006
@jowadulkader9006 5 лет назад
ok i get the point.i thought inserting at 0 will remove the previous insertion.anyway thanks
@LucidProgramming
@LucidProgramming 5 лет назад
Hi Jowadul. There shouldn't be any clash, as the enqueue function will automatically place the element in the next spot in the queue. I might be misunderstanding your question as well.
@eliobteich4133
@eliobteich4133 4 года назад
Why have you used __len__ and size method, couldn't we use only one of them? Isn't it the same?
@LucidProgramming
@LucidProgramming 4 года назад
__len__() is just a wrapper for size. Using defining the behavior of __len__ allows us to override the built-in len() function for our object.
@shuaishao2584
@shuaishao2584 4 года назад
a question about line 17, queue.peek() only returns the node, shouldn't we use queue.peek().value?
@LucidProgramming
@LucidProgramming 4 года назад
It depends on the intent. For how we use the peek function, no.
@jojoesekyisagoe
@jojoesekyisagoe 4 года назад
Hi Sir, thank you for the series. I have a question. In the code for the level order traversal, why didnt you use the built in python list for the queue. like below: def levelOrderPrint(self): ret = [] track = [] cur = self.root track.insert(0, cur) while len(track) != 0: cur = track.pop() ret.append(cur.data) if cur.left != None: track.insert(0, cur.left) if cur.right != None: track.insert(0, cur.right) return ret Because the built in list can do all of the needed operations. Is there any reason for the queue implementation?
@LucidProgramming
@LucidProgramming 4 года назад
Sure, it can do all the same things, but the queue object is going to give better runtime if you want to remove from the front / add to the back / etc.
@kinjalvora3352
@kinjalvora3352 2 года назад
just used your logic and instead of creating a queue, used an array and came with the following: def level_order(self, start, traversal): # create a queue # append the first root element # pop the first element, print it, and check if it has a left and a right node and append it to the stack # pop again the first element that has been appended in the stack, print it and then check again # 1, 1 has 2 and 3 to append # 2 pops, 2 has 4 and 5 to append # 3 pops, 3 has 6 and 7 stack = [start] while stack: start = stack.pop(0) traversal += (str(start.value)+'-') # print(start.value, end="-") if start.left: stack.append(start.left) if start.right: stack.append(start.right) return traversal
@pavassrivastava3323
@pavassrivastava3323 4 года назад
Heyy great tutorial.... I am not able to understand the concept behind .value in peek function. Is it some kind of inbuild function as we didn't define the "value" variable in our queue class. In my opinion the function should return self.items[-1]...but its showing error if I'm not using self.items[-1].value..
@LucidProgramming
@LucidProgramming 4 года назад
Peek is not an in-built function, we define it ourselves.
@GOSPGABO
@GOSPGABO 3 года назад
What is de difference between Level-OrderTraversal and BSF?
@LucidProgramming
@LucidProgramming 3 года назад
Breadth-first traversal and level order are basically the same thing.
@KKinHD10
@KKinHD10 4 года назад
Thanks for such amazing tutorials , but I wanna ask - can we apply iteration method for DFS traversals aswell? I always found Recursion confusion so I was wondering can't I use just the iteration method to implement DFS :)
@LucidProgramming
@LucidProgramming 4 года назад
Sure, generally anything you can do iteratively you can do recursively and vice versa.
@KKinHD10
@KKinHD10 4 года назад
@@LucidProgramming Thanks for replying sir but one more thing : Can you make a detailed video on how recursion works in such cases?? I understand basics of it but i am not able to understand your implementation and how the traversal string is updated . I request you sir, if you get the time please make a short video explaining how recursion works in such situations where we update a given string via function calls. I really need to understand how it works in order to implement it for any use :)
@LucidProgramming
@LucidProgramming 4 года назад
@@KKinHD10 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
@Ishanmahesh1992
@Ishanmahesh1992 5 лет назад
Just one doubt. Whether we can use Len function directly instead of modifying it ??
@LucidProgramming
@LucidProgramming 5 лет назад
I don't understand your question. Where and how are you intending to use the "len" function?
@Bayo106
@Bayo106 3 года назад
Is this also known as Breadth First Search?
@LucidProgramming
@LucidProgramming 3 года назад
Yes.
@Captainadityaa
@Captainadityaa 4 года назад
class Node(object) see this object was not in linked list class why?
@LucidProgramming
@LucidProgramming 4 года назад
That's the way you define a class.
@Captainadityaa
@Captainadityaa 4 года назад
@@LucidProgramming but sir, in linket list it was just class Node:
@LucidProgramming
@LucidProgramming 4 года назад
@@Captainadityaa Your comment makes no sense to me.
@Captainadityaa
@Captainadityaa 4 года назад
@@LucidProgramming leave it. I'll google
@kimber8324
@kimber8324 4 года назад
@@LucidProgramming He's referring to the Linked List videos that you created. When creating classes in those videos, you defined the class as: 'class LinkedList:', whereas in this video you defined the Queue class as: 'class Queue(object):' -- I'm kind of curious about this myself as I'm fairly new to creating classes in python. If the inclusion of (object) necessary in certain cases and not others?
@Ishanmahesh1992
@Ishanmahesh1992 5 лет назад
I am slightly confused..pls advice. peeking for first element in line doesn't mean we should grab the element with index 0 ? But -1 is taken in peek.
@LucidProgramming
@LucidProgramming 5 лет назад
No. We are looking for the element at the top, therefore it's the last element in the list, which is given by the "-1" syntax.
@dewanggedia685
@dewanggedia685 4 года назад
@@LucidProgramming Thanks for posting programming videos. It has been a great learning. The concept of peek still isn't clear to me. Why don't we do peek at 0th element since 0th element will be first in queue and -1th element will be last element in queue. Also, while inserting aren't we supposed to append to the end of the list? Here, we are always inserting at 0th element so by that logic right element would precede the left element. Please help me to clarify this. Thanks in advance.
@LucidProgramming
@LucidProgramming 4 года назад
@@dewanggedia685 Ah, I see, and you know what, the peek for a queue should definitely take from the front. I suppose I was implementing a stack, really, for this level order traversal. The data structure implementation here does the trick, but I can see where this is misleading. I'll update the code on my github with appropriate comments. Thanks for pointing that out to me, and sorry for the confusion!
@rishikeshpuri6101
@rishikeshpuri6101 4 года назад
@@LucidProgramming sir, same confusion in Queue -1 index is from starting ? sir clarify it.
@LucidProgramming
@LucidProgramming 4 года назад
@@rishikeshpuri6101 -1 index is from the back.
@fpvcoder9200
@fpvcoder9200 4 года назад
which vim plugin are you using for the intellisense?
@LucidProgramming
@LucidProgramming 4 года назад
That's all described in the link in the description of the video. Cheers!
@prathamgupta7605
@prathamgupta7605 2 года назад
why are you not making any video now?
@LucidProgramming
@LucidProgramming 2 года назад
Life? Honestly, I'm just quite busy these days. I hope to get back to it though
@prathamgupta7605
@prathamgupta7605 2 года назад
@@LucidProgramming I just wanted to say I love your videos and your organized way of representing the things. I hope to see you soon.
@LucidProgramming
@LucidProgramming 2 года назад
@@prathamgupta7605 Thanks!
@funnykid_purab4020
@funnykid_purab4020 3 года назад
can you share the link for graph also
@LucidProgramming
@LucidProgramming 3 года назад
For graph?
@funnykid_purab4020
@funnykid_purab4020 3 года назад
@@LucidProgramming graph data structure
@LucidProgramming
@LucidProgramming 3 года назад
@@funnykid_purab4020 I'm not sure I understand. What makes you think I have a link for this?
@funnykid_purab4020
@funnykid_purab4020 3 года назад
@@LucidProgramming am asking have you made any video on graph data structure like tree?
@LucidProgramming
@LucidProgramming 3 года назад
@@funnykid_purab4020 Trees, yes. You can find those on my channel under the "Trees" playlist. Graphs, sadly not.
@AmitKumar-tl6sx
@AmitKumar-tl6sx 5 лет назад
thanks for creating and sharing the nice video . i am not able to get the logic of peek function in class queue you are using -1 index , please explain. self.items[-1].value
@LucidProgramming
@LucidProgramming 5 лет назад
Hi Amit. No problem, I hope that the video was useful to you! The general gist of the negative indexing is that it goes backward in the list. For instance self.items[-1] is the last item in the self.items list. The element self.items[-2] is the second to last item in the list and so on. Does that make sense? Actually, if you're interested in staying up-to-date with the content on my channel, you might want to sign up for the mailing list I'm starting: bit.ly/lp_email Cheers!
@mikedotleb
@mikedotleb 4 года назад
Each time enqueue is called (inside the if conditions), the start/item argument (whichever node you're on), is placed in the 0 index (first position) of the Queue self.items list. The peek method is returning the value of the last index position of the items list: self.items[-1].value This works because the enqueue method keeps placing the nodes it checks in sequential order at the beginning of the list (the zero argument in self.items.insert(0, item)). Meaning that even if it checks if a left node exists and places it in the first element, it will then go and check if a right node exists and then place THAT element in the 0 position (before the previous left node check), allowing the peek function to return the value of the left node - which is now the last item in the list. After calling the peek method, the dequeue method is called to pop out the last element of the Queue self.items list, allowing the process to repeat now with the peek method returning the next value in the self.items list (which would be the right node after a left node's value was returned). Hope that made some sense.
@mohitweekendvlogs
@mohitweekendvlogs 4 года назад
@@mikedotleb now it make sense thanks
@jhoanmartinezsilva2609
@jhoanmartinezsilva2609 4 года назад
You have to be a hater to dislike this video, big thanks
@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!
Далее
Binary Trees in Python: Reverse Level-order Traversal
13:16
Sigma Girl Pizza #funny #memes #comedy
00:14
Просмотров 1,7 млн
Binary tree: Level Order Traversal
11:23
Просмотров 604 тыс.
Binary Search Tree in Python
22:59
Просмотров 49 тыс.
How Fast can Python Parse 1 Billion Rows of Data?
16:31
Fast Inverse Square Root - A Quake III Algorithm
20:08
Level Order Traversal | Tree | HackerRank | Python
12:24