Тёмный
Brian Faure
Brian Faure
Brian Faure
Подписаться
Welcome! My videos consist of coding tutorials (mainly in the Python coding language), as well as older gaming and virtual reality videos.

Click the link on my cover photo to visit my Github account if you'd like to find any of the code used in my coding tutorials.
AVL Tree: Background & Python Code
24:24
6 лет назад
Reading & Writing Files In Python
12:03
6 лет назад
Easy Password Generator In Python
8:06
6 лет назад
Unity Test Landscape [HTC Vive]
2:11
7 лет назад
Introducing WikiClassify
0:53
7 лет назад
Комментарии
@ETR12935
@ETR12935 5 дней назад
First dsa video! the keyboard sound was just 🤩
@chloeliu9207
@chloeliu9207 11 дней назад
After searching thousand of videos at ytb, this tutorial is the most helpful and insightful! thanks!
@BrianFaure1
@BrianFaure1 11 дней назад
@@chloeliu9207 Awesome news! Happy the video helped you ✌️
@user-ul2hj8zf1y
@user-ul2hj8zf1y 24 дня назад
Bro you're different level
@angryman5517
@angryman5517 Месяц назад
didn't get shit.
@duinterweb
@duinterweb Месяц назад
This got me passed my bootcamp. I watched as many as 5 different binary search tree node remove videos but I could not figure out how how to do it. I stumbled onto this video and I watched it multiple times. It finally clicked. Thank you. I would still be sitting at my computer without this.
@Antinormanisto
@Antinormanisto 2 месяца назад
Broooo, thank you very much. I search how to delete a node for 2-3 hours. You saved me
@hemanthkumarar
@hemanthkumarar 2 месяца назад
At 11:50 I think it should be if index > self.length() instead of index >= self.length() This will ignore the last element and it cannot be accessed. I am still a newbie, correct me if I am wrong. Anyway, great series, thank you sir
@mohammad-bunyanish
@mohammad-bunyanish 2 месяца назад
Why are you creating 2 classes
@croakinglizard2156
@croakinglizard2156 3 месяца назад
thanks for your help!
@SLowe-xi3fq
@SLowe-xi3fq 3 месяца назад
Can't we just say while current != None (or while current)? we dont necessarily need to make sure we have 2 nodes before null right?
@pets__tube
@pets__tube 3 месяца назад
moueeeeeeeeeeeeeeeeeeee
@apalsnerg
@apalsnerg 4 месяца назад
Thank you so much for this! This is just what I needed to understand linked lists properly!
@sasidharnaidu4507
@sasidharnaidu4507 4 месяца назад
Dictionary has been made an Ordered collection since Python 3.7
@user-eq9zo5vj7c
@user-eq9zo5vj7c 4 месяца назад
I struggled a lot with DSA until I found this channel. Now I struggle a lot less thanks to you.
@Ahmed-um4yl
@Ahmed-um4yl 5 месяцев назад
I love you man
@m.ldt8
@m.ldt8 6 месяцев назад
I know I'm really late about these ones, but thanks a lot for all your videos. They could'nt be more useful before my python test. I don't understand why arn't u already famous ! Ur explanations are so clear please never stop doing video's
@laurapachon7917
@laurapachon7917 6 месяцев назад
This week I found your videos, for a topic that I really didn't understand and I just want to thank you for your work! you explain very well, I love to learn like this. Keep it up, you must upload videos transmitting your knowledge
@RamachandraBharadwaj
@RamachandraBharadwaj 6 месяцев назад
very understandable !
@motheotreasurepuso0724
@motheotreasurepuso0724 6 месяцев назад
Great video. On your erase, I think it is essential to reassign the self.head for when erase is called at index= 0 so that it does not stay as None
@PrinceAdom
@PrinceAdom 6 месяцев назад
Instead of doing another costly iteration through the linked list to find the size of it. We can add a self.length variable to the init() with an initial size of 0, and then add a 1 in the append() and a subtract a 1 in the remove method
@rahadulislamrahat328
@rahadulislamrahat328 7 месяцев назад
Do you have video in Graph a nd algorithm
@BegForMyMercy
@BegForMyMercy 7 месяцев назад
doesn't work if you repeat deletion of the same value fyi For the function delete_value, we need to catch this edge case. def delete_value(self, value): if self.find(value) == None: #if we can't find the value return None return self.delete_node(self.find(value))
@kevinzebb
@kevinzebb 7 месяцев назад
My nigga, good stuff
@dennisearle
@dennisearle 8 месяцев назад
Thanks, Brian. Really helpful.
@marc4117
@marc4117 9 месяцев назад
dunno how it worked for you but i had to set "self.head = None" otherwise i got an error that attribute "data" is missing
@yolamontalvan9502
@yolamontalvan9502 9 месяцев назад
Thank you I was wondering how do you create pointers in Python. My favourite languages are C++, C#. It took me three years to learn them. I think I’m going to give Python a try, it looks easy. Thank you.
@techandmore12
@techandmore12 9 месяцев назад
Actually this implementation is not 100% correct. The actual first element or the head of the linkedList will always be none as per the provided implementation. You would have to check if the head has a next element and if its data is none. If so, the head node should get the data: def append(self, data): new_node = Node(data) current = self.head while current.next is not None: current = current.next if current == self.head and self.head.data is None: current.data = data else: current.next = new_node
@softwareengineer8923
@softwareengineer8923 10 месяцев назад
Your explanation is too clean and lucid.Thanks for a great video!
@polsiv
@polsiv 10 месяцев назад
Great video dude, it helped me a lot!
@denisemarques7117
@denisemarques7117 10 месяцев назад
Do you still freedive in the NJ area?
@donfeto7636
@donfeto7636 11 месяцев назад
The code is not readble at all , also the header is always none and you built the code on that not a good way of coding linkedlist to be honest
@donfeto7636
@donfeto7636 11 месяцев назад
class node: def __init__(self, data=None): self.data = data self.next = None class linked_list: def __init__(self): self.head = node() # Adds new node containing 'data' to the end of the linked list. def append(self, data): new_node = node(data) if self.head.data == None: self.head = new_node else: cur = self.head while cur.next != None: cur = cur.next cur.next = new_node # Returns the length (integer) of the linked list. def length(self): cur = self.head count = 1 while cur.next != None: count += 1 cur = cur.next return count # Prints out the linked list in traditional Python list format. def display(self): elems = [] cur_node = self.head while cur_node.next != None: elems.append(cur_node.data) cur_node = cur_node.next elems.append(cur_node.data) print(elems) # Returns the value of the node at 'index'. def get(self, index): if index >= self.length() or index < 0: # added 'index<0' post-video print("ERROR: 'Get' Index out of range!") return None cur_idx = 0 cur_node = self.head while cur_node.data != None: if cur_idx == index: return cur_node.data cur_node = cur_node.next cur_idx += 1 # Deletes the node at index 'index'. def erase(self, index): if index >= self.length() or index < 0: # added 'index<0' post-video print("ERROR: 'Erase' Index out of range!") return curr_idx = 0 last_node = self.head if index == 0: self.head = self.head.next else: curr_idx = 1 while True: curr_node = last_node.next if index == curr_idx: last_node.next = curr_node.next return last_node = curr_node curr_idx += 1 l = linked_list() l.append(1) l.append(2) l.append(3) # 2 l.append(4) l.display() l.erase(1) l.display() little bit readable code
@Caller8194
@Caller8194 Год назад
why would someone use this over a normal list? i cant think of a situation where a linked list would be more useful when compared to an array
@jiminycricket2945
@jiminycricket2945 Год назад
sort the comments here by "newest first" and read the comment I posted about 4 or 5 comments before this one:)
@MCNeko6554
@MCNeko6554 Год назад
Thank you, helped me finish my homework without losing my mind x'D
@micmike
@micmike Год назад
Hello, yes I do enjoy your videos and teaching method/style. Wish there were more video's to view.
@raoufmahdi5114
@raoufmahdi5114 Год назад
thank you so much
@nikoskaragiannis6353
@nikoskaragiannis6353 Год назад
I agree.
@turk-money
@turk-money Год назад
Great video, thanks for the post.
@djlazer1
@djlazer1 Год назад
I love you dude thanks for explaining this stuff so clearly. So many other channels explain this stuff so badly, but you make it so easy to understand.
@happymalyo_
@happymalyo_ Год назад
Great Vidéos !!!!
@jiminycricket2945
@jiminycricket2945 Год назад
Beware. While this is a good presentation of how linked lists work, it gets the single most important detail wrong. The whole point of using a linked list as opposed to a regular list in python is that it has better time complexity when you need to frequently add and remove items from the FRONT, like a FIFO data structure or queue. The append method in the code presented here has to iterate through the entire data set to add a new element which is O(n), but a proper linked list should add new data to the FRONT, which improves time complexity to O(1). Instead of an append method(or at least in addition to) it should have something like an add() method which could look something like this: def add(self, data): new_node = node(data) new_node.next = self.head.next self.head.next = new_node
@pharaoh9483
@pharaoh9483 11 месяцев назад
He replied 5 years ago with this when someone mentioned about the append being O(n) Hi Xiufeng, thanks for the nice words! Yes the way the append function works currently is O(n), and is not the most efficient. By adding in an extra class member variable, we can call 'tail' for example, we can reduce the complexity of the append function down to constant time, or O(1). A possible implementation could be as follows: > def append(self,data): > new_node=node(data) > self.tail.next=new_node > self.tail=new_node Take note that for this to work, we will need to declare this 'tail' variable in the constructor of the class: > def __init__(self): > self.head=node() > self.tail=self.head If you wish to take this approach, you'll also need to be careful to set the 'tail' correctly inside of the 'erase' function (for example, if you try to erase the last element in the list, you'll need to set the tail to the new last element). The following 'erase' function includes a single 'if' statement which should achieve this: > def erase(self,index): > if index>=self.length() or index<0: > print "ERROR: 'Erase' Index out of range!" > return > cur_idx=0 > cur_node=self.head > while True: > last_node=cur_node > cur_node=cur_node.next > if cur_idx==index: > last_node.next=cur_node.next > if last_node.next==None: self.tail=last_node ## Here is where we set the tail > return > cur_idx+=1 I've done some simple tests with this new implementation and it seems to be working, but feel free to let me know if you find any issues or have any other questions! I'm going to pin this comment so any others with the same question can see it.
@blankdisk1061
@blankdisk1061 Год назад
.
@leonchang9692
@leonchang9692 Год назад
thank you
@commandprompt7171
@commandprompt7171 Год назад
thank you for explaining the erase method, I was confused from another video on how the element gets deleted by just assigning the last node
@mizzzile
@mizzzile Год назад
Quick and short recap.
@lilyan4830
@lilyan4830 Год назад
What textbook are the screenshots from? For example at time stamp 3:25
@lilyan4830
@lilyan4830 Год назад
especially 3:26 and 3:27
@magnuswootton6181
@magnuswootton6181 Год назад
as u can see a single neuron in a neural network is one complete output on a single layer. so a single layer with one output is just one single neuron.
@magnuswootton6181
@magnuswootton6181 Год назад
that ai winter is just bullshit. how much other bullshit is going around and ppl dont notice just passes for truth?!?!? do ppl know and say to themselves "oh ppl think thats true at the moment so i just continue it on." u just cant trust anyone.
@YorkshireSpud
@YorkshireSpud Год назад
Thanks for this video, you've explained the code and data structure really thoroughly and I'm starting to understand the implementation of LinkedLists. However, I found a bug with the length method that you wrote in the video. I found that if you try to access the last element of LinkedList it will raise the error due to the count starting at 0 rather than 1. The fix is simply start the count at 1 because it counts the empty node and makes the final element inaccessible via the get method that you defined. Also, with the change above, you want to move the `if cur_index == index: return cur_node.data` statement to the top of the while loop or you'll get an error stating cur_node.data is None (the get method)
@YorkshireSpud
@YorkshireSpud Год назад
Worth mentioning that `d = {}` could actually become a `set` if you're not careful. Some suggest using the constructer object instead. E.g. `d = dict(my_key="my_value")`
@sasidharnaidu4507
@sasidharnaidu4507 4 месяца назад
I don't think so. The set can be created using set() constructor only.
@bhavishahadiyal7836
@bhavishahadiyal7836 Год назад
Best explanation ever please never stop making great videos, we will subscribe