5 minutes and you taught me more then my own lectures could, you kept in concise unlike other videos, straight to the point and very well worded. I thank you highly!!
I failed my quiz because of this video, should have read the comments first. Everyone be warned, the lower frequency number must always be on the left, not the right, this is not something he practices in this video. Where he goes wrong is that he sorts from highest frequency to lowest in the queue, when it should be the opposite
it doesn't matter which way you visualise the queue (left/right), it matters which side you take the elements out of the queue (you should be taking the lowest frequency elements). I don't think the video creator is at fault for this.
i've been watching many videos explaining this lesson but couldn't understand it because they always miss the point that i should move the bigger value to the left, i have a final exam after 4 days and now i'm ready for it because of you, thank you so much.
This is how to decode properly: 1. Take a bit from the encoded string. 2. Start at the root of the tree. 3. Follow the edge denoted by that bit value to the adjacent node. 4. If the node is a leaf, then return the corresponding character. 5. Otherwise take the next bit from the encoded string and continue following down the tree until a leaf node is found. Example: 1. Start with the first bit in the encoded string, which is 1. 2. Start at the root of the tree. 3. The root is obviously not a leaf, so follow the edge marked 1 and we reach the leaf node, which is ''A'. 4. Then take the next bit, which is also 1. So, follow the step 3 above and return 'A' again. 5. Then take the next bit, which is 0 and start at the root again. 6. The edge 0 from the root leads to a non-leaf node (marked 4). 7. So, take the next bit from the encoded string, which is also 0 and continue following from the last node where we were at in the last step (which is the non-leaf node 4). 8. If we follow the edge 0, we reach a leaf node denoting character 'B'. 9. And so on.. The important point is every time we find a character, we take the next bit from the encoded string and start at the root of the tree.
The node with value 4 should be on the right side instead of A3 because it has a larger value. So, node with value 7 has left child of A3 and right child of 4
I think this answer is wrong because of that we need to write the small number to the left side of the tree . you have done the opposite . I mentioned the 2:02
How would it work if there were more symbols to account for? And then there would be I, and II in the same algorithm. How would we know to differentiate between 2 I or 1 II? Hope I'm making some sense!
This cheats a little bit though - how does the decoder side magically know the Huffman tree? In actual practice, the part that sometimes needs a ton of cleverness is compactly encoding the tree into the output. Sometimes you can get away with a hard-coded tree that works well most of the time.
I actually understand how this works now... I just wonder... about those... like extra... those non usable extra bits people chuck out... Like... You think they could be used for extraneous packing somehow? Hmmmm. I dunno, this is good enough. You explained in a few seconds(knew where to fast forward) where profs you tube videos couldn't
Yeah but where would you store the tree structure? That is still ambivalent to me, without the tree you cant figure out what is what oh wait I get it, its like any other thing where the table is generated instead of static, you store the table, or at least enough information to generate it alright there we go thank you!!!!!!
1- You have to use a priority queue. 2- IF a number is bigger you have to put this number in the right of the tree, if is smaller in the left, you are giving wrong informations. Please, delete this video and make the correct video. 😁
No, if you change the A to the left side (0) you have to switch the whole tree. The pattern of left = 0 & right = 1, has to be the same for the whole tree.