Hello! My name is Vinnie and I have a Ph.D. in computer science. I enjoy making programming and computer-related tutorials. For more information about me, my research, etc. please do visit my personal website: vprusso.github.io/
If you're so inclined to support this channel, I appreciate any and all support. Whether it's monetary, a like, a subscribe, I appreciate all feedback and comments. Thank you for checking this channel out!
Hello Mr Lucid, your lecture is very great, but there is a typo in function of postorder_print() traversal = self.postorder_print(..) instead of inorder_print, which leads to incorrect result the result should be 4-5-2-6-7-3-1 ( I hope I am right after learn your teaching ^^!)
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.
its not a correct solution when you are replacing you should use str_2=str_2.replace(c,"",1) then this will work but the time complexity will increase @lucidProgramming
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?
Thank you so much for creating these data structure videos. I finally understand how to create python class and how to code linked list. Another idea for swapping two nodes is to create two empty linkedlist in the function and point those linkedlists to the nodes that to be swapped. And then just swap the data. This way we do not need to keep track of where the .next part goes and we only need to iterate through the original linkedlist once. The code looks like this: def ll_swap(self, data1, data2): if data1==data2: print('the two values are the same. Nothing to swap') return if self.ll_length() is None or self.ll_length()<2: print('not enough nodes to swap') return ll1=LinkedList() ll2=LinkedList() curr_node=self.head while curr_node: if curr_node.data==data1: ll1.head=curr_node if curr_node.data==data2: ll2.head=curr_node curr_node=curr_node.next if ll1.head and ll2.head: #swap the data of the two nodes that are marked by ll1.head and ll2.head ll1.head.data, ll2.head.data=ll2.head.data, ll1.head.data return print('the data to be swaped is not in the linked list') return
3:59 says join makes sure all processes started have SUCCESSFULLY completed. Kind of misleading. There are many ways to complete, like throwing exception is also considered complete. Key point when join is about child process/thread ending it's execution, which may or may not mean running to the last line in the script.
12:27 says all adds are completed before all subs. That is not true. Add a print after each function like print(f"{total.value} after add/sub") to see that it's actually interweaved and fluctuating around 490-510, but eventually ending on 500
I have looked at A LOT of python parallel videos and this is the first one that worked! I also added a print line to the serial function to confirm the output; they were consistent. Furthermore, it worked well and can be adapted easily for more advanced applications. Thank you!
It seems multiprocessing doesn't directly work with Jupyterlab (or IPython, not sure), one workaround is to have the worker function in a separate .py file and imported. Also, I am not sure about the high level concurrent module, but I think it's important to let new multiprocessing learners know about this at the beginning, thanks.
thanks good tutorial; tho you have a bug which is python's fault to be honest. It has allowed you to do this: return self.preorder_print(tree.root, "") ; it had to be self.root
There's a bug in your code. you need to return here def append(self, data): if not self.head: self.head = Node(data) self.head.next = self.head return otherwise, it'll be stuck in infinite loop
Unfortunately, pandoc can't scale images from screenshots correctly. For that reason images' titles are going out of the lower slide bound. Any recommendations?
Your explanation was really amazing, you should come back make more of this awesome videos. I was confused all day about how to define the bst functions and magically youtube suggested your channel.
@lucidProgramming Python 3.10/centos7 When I paste the code from Part 4 into my py file and run it, i get an error putrequest raise InvalidURL(f"URL can't contain control characters. {url!r} http.client.InvalidURL: URL can't contain control characters. '/youtube/v3/videos?part=snippet&id=f3FyWUG1w_M &key=' (found at least ' ')
Thanks! Honestly, I wish I still was too. Time is a bit of a limited resource for me these days, but I hope to get back to uploading! Thank you for the support!
def find_upper(word, i): if i >= len(word): return word if word[i].isupper(): print(f"{word[i]} is upper.") else: print(f"{word[i]} is lower.") return find_upper(word, i+1) print(find_upper("Hello World", 0))
Hi, Your videos are very informative. Any idea how to swap a doubly linked list in pairs eg: 1 <-> 2 <-> 3 <-> 4 should become 2 <-> 1 <-> 4 <-> 3 . Any easy solution pls