Another example for my students learning Huffman coding. In this video I show you how to build a Huffman tree to code and decode text.
Пікірлер: 84
@Aaliyah19099 ай бұрын
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!!
@Lerieal2 жыл бұрын
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.
@mikhailwebb837710 ай бұрын
how did the exam went?
@sahitdodda50465 ай бұрын
@@mikhailwebb8377not well for them, the convention is to have the bigger value on the right, NOT the left. The video gets it wrong
@MoguMogu8185 ай бұрын
I had a two hour lab on Huffman coding and couldn't understand shit. This taught me instantly when you mentioned "priority queue".
@damarisgoumtsop63194 ай бұрын
what school you going to if i may ask ?. I've the same lab lol
@mattels Жыл бұрын
Amazing Video, I spent maybe an hour trying other videos to understand this, but somehow you managed in just under 5 minutes.
@dider9 ай бұрын
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.
@badbanana25476 ай бұрын
Thank you! I read through all the comments looking for this specific thing
@kamalkishor149310 ай бұрын
Brother, You are tremendous... I Love the way you explained!!
@Connapasko5 ай бұрын
this broke my brain in college and somehow you made it so clear in
@rygerety83842 жыл бұрын
Was searching through this and found this video... I had completely forgotten that u had made a vid on this
@MagnificientLlama Жыл бұрын
You sir are wonderful help for my finals preparation
@dankmemes34472 ай бұрын
5 minutes and i understood it! thanks for saving my bachelors for now
@Backflipmarine3 жыл бұрын
thanks for the vid, also learnt 5678 (56=7*8), easy way to remember
@a96futurecreator96 Жыл бұрын
2:15 why is 4 at left side of 3 (node a3), I thought everything bigger than the node should go to the right side.
@kamalkishor149310 ай бұрын
In very first step, You have to decide where you want to put the element. Either on left or right side.
@baraa24594 ай бұрын
True, it was a mistake i think and few people noticed it !!!!!
@vishwajeet505111 ай бұрын
this was just what i was searching for
@princeofexcess3 ай бұрын
when sending on the network you also have to send the tree to decode it on the other side. So i doesnt pay of for short strings.
@TimnitAsamnew7 ай бұрын
i did not get why you write A3 on the right side
@sat_this_h7 ай бұрын
Yes, I think it should be on the left since it's smaller than 4
@Ahmedibrahim-xv1je6 ай бұрын
Should be on left
@marianosalcedo3803 Жыл бұрын
You explained this so well, thank you
@douggale59625 ай бұрын
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.
@SpacePunk10004 ай бұрын
at 1:38 B and 2 are equal so does it matter which you put first? Could you put A then 2 then B?
@victoralvarez96014 ай бұрын
whats the song in the background?
@Yureka-ox5jn6 ай бұрын
What about the codes to decode? Are they also transferred with the file?
@rummanchowdhury3807 Жыл бұрын
Great succinct explanation!
@hoki8296 Жыл бұрын
It was really helpful. Thank you
@yasmineguemri3 ай бұрын
amazing video! thanks !!
@mr.zafner829511 ай бұрын
What an excellent explanation. Thank you so much
@PizzeyTechnology11 ай бұрын
Glad it was helpful!
@nc7374 ай бұрын
The decoding is not really explained by this -> how do we know to decode only 1 bit, from 1 to A vs 2 bits from 11 -> whatever
@PaulG1062 жыл бұрын
Wow! Thank you!!
@PizzeyTechnology2 жыл бұрын
Welcome!
@mikebabz Жыл бұрын
The background music is intruding
@LugiPaule5 ай бұрын
great video bro
@rain_yy5 ай бұрын
Thank you!
@Timmy-oo2vx Жыл бұрын
really good vdo I recommend this
@galbalandroid2 жыл бұрын
what to do if our tree (in the progress of building it) is for example 3 and we have 2 options 2 and 2.5 for example?
@JeezVince Жыл бұрын
excellent
@arunimachakraborty1175 Жыл бұрын
Thanks a lot!
@HighlandCatz Жыл бұрын
thanks
@RuthDillard-b4b17 күн бұрын
Douglas Wall
@kacperkwasny38483 ай бұрын
ktos kik?
@alessandrolobosco76868 ай бұрын
This tutorial is totally wrong :)
@alessandrolobosco76868 ай бұрын
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. 😁
@ahmetsahin11474 ай бұрын
i have orgazm watching this
@BloodTonyPeriod4 ай бұрын
bro does NOT know what hes doing
@boredguy5805 Жыл бұрын
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
@glitterfart11 ай бұрын
Thanks man, have a test tomorrow.
@oguzhanalasulu56784 ай бұрын
I also realized it. Thanks for feedback about this situation, bud!
@jonatahnelhadad74304 ай бұрын
i also failed my question i came back after failing and sadly only now i noticed your comment...
@liam_iam4 ай бұрын
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.
@YitzhakPrince-IsaacАй бұрын
Yeah cuz I was like somethings wrong here had to browse the web for minutes thanks tho!!
@w花b9 ай бұрын
Just 5 minutes to understand that. Couldn't be more concise. Great job
@jackc7475 Жыл бұрын
Perfect video, with clear concise demonstration, fully helped me understand Huffman coding, thank you
@melihcanyldz368 Жыл бұрын
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
@baraa24594 ай бұрын
True, thank you for noticing I thought my lectures were wrong 😂
@giraysekerlen5150Күн бұрын
I would appreciate this even more if you had mentioned the property of prefix-free codes. otherwise, one could get confused about how to determine where one code ends and the next one begins.
@giraysekerlen5150Күн бұрын
still, that's hell of a job the way you explained it, thank you so much!
@sunilbrevannavar13792 ай бұрын
how does one break the tie of frequencies , alphabetical order?
@matansavage24 күн бұрын
amazing tutorial thanks
@xfxdedfade63878 ай бұрын
This was so concise, I have a presentation tomorrow and this saved me, thank you.
@tiradeee3 жыл бұрын
i have my paper 2 FINAL gcse exam tomorrow, so one question: where u put the binary, is it ALWAYS 0 on the left and 1 on the right?
@rygerety83842 жыл бұрын
Not always, but usually
@FoxGlove8Ай бұрын
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!
@homeopathicfossil-fuels478928 күн бұрын
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!!!!!!
@leoliang110 ай бұрын
Hey your huffman tree is backwards. The smaller ones should go on the left
@البراءبنمالك-ر1مАй бұрын
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
@staa65893 ай бұрын
thank you very much, very nice explanation
@christio029 ай бұрын
Thank you! You explained better than a 3 hour lecture did
@BrightCherry-e8b5 күн бұрын
Jabari Estates
@StracheyLou-h3e24 күн бұрын
Cleora Mission
@GoodNewsJim3 жыл бұрын
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
@vampire_catgirl2 жыл бұрын
I don't think so, if you made them do anything then whatever code you use to decompress wouldn't know to keep going for a letter
@Hustlers_hab8 ай бұрын
enjoying the beat.
@caitlinn34553 жыл бұрын
thank you
@PizzeyTechnology3 жыл бұрын
You're welcome
@AlphyCabante Жыл бұрын
this is wrong the answer is A= 0 b= 10 c=110 d=111
@ickebins69486 ай бұрын
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.