Huffman Encoding First Try

  Рет қаралды 17,750

TheVimeagen

TheVimeagen

Ай бұрын

LIVE ON TWITCH: / theprimeagen
Become a backend engineer. Its my favorite site
boot.dev/?promo=PRIMEYT
This is also the best way to support me is to support yourself becoming a better backend engineer.
Get in on Discord: / discord
Get in on Twitter: / theprimeagen
Got Something For Me to Read or Watch??:
/ theprimeagenreact

Пікірлер: 37
@nb6175
@nb6175 Ай бұрын
wasn't there a famous writer who held their pee as a productivity hack, not allowing themselves to urinate until they'd written a certain number of words. I believe they ended up having severe bladder problems.
@notuxnobux
@notuxnobux Ай бұрын
That's me, but when I have to shit and I want to finish writing the code so I can compile it while I shit
@rektifyr...
@rektifyr... 26 күн бұрын
Skill issue, should've typed faster.
@MorningNapalm
@MorningNapalm 13 күн бұрын
There was one who refused to leave the toilet until they had written a certain number of words :D
@musimsek
@musimsek Ай бұрын
There is a video on "Reducible" channel that explains Huffman encoding waay better, I recommend people to watch that one first then see the simple implementation here
@lonederanger3581
@lonederanger3581 Ай бұрын
Thanks! This channel looks great.
@sr-gt6fk
@sr-gt6fk Ай бұрын
since u take the smallest two letters and merge them, nodes you create are in increasing frequency, so u can use two queues instead of a priority queue, first is for the original letters (that u sort beforehand) and second for merged nodes then to take minimum check the heads of the two queue and pop (do this twice for two min ) and push the new node to the back of the second queue
@theodorealenas3171
@theodorealenas3171 Ай бұрын
This looks similar to me doing leetcode style exercises for Uni, but without the skill issues and the starring at the wall.
@satyayuga0
@satyayuga0 Ай бұрын
THE NAME... The FirstTryAgen!
@u9vata
@u9vata Ай бұрын
This algorithm was class material in my high school second year in Hungary 🙂
@ramb0lxmb
@ramb0lxmb Ай бұрын
congrats. this is why hungary is at the forefront of the tech world today.
@u9vata
@u9vata Ай бұрын
@@ramb0lxmb No - but compared to gdp / capital the whole region has a lot of people in high-tech companies all around the world. Hungary nowadays is climbing up actually (there will be finalists in ACM ICPC finally again and a Hungarian team just got gold medals in team informatics olympiad on high school level (the other team nearly got to be 3rd too) so yes educations seems progressing in good direction. The "traditional" king of the region is Poland though - also Czech is not bad plus Belorus too capable... Its very hard to progress from regional semifinals to world wide algo contests usually its a regional thing... Its just simple: If you cannot afford to just "buy" minds like usa pretty much only lives on nowadays... then you need to be clever and have a good education system. That being said it would be nice for usa if they also have a good education system, but where there is enough leeway in the economics its easier to slip and make it shit haha. That's all.
@another212shadow
@another212shadow Ай бұрын
There's adaptive huffman too that encodes in real time. Buit Burrows-Wheeler transform then RLE then huffman is what you really want to do
@ErazerPT
@ErazerPT Ай бұрын
Thank for that one. I was getting some decent results just using Brotli, but applying what you mentioned and then Brotli shaves off another 200-100 bytes, which was ~10-20% saving on my data. Times suffer a bit though, as can be expected. Tradeoffs, always tradeoffs ;)
@saidwho9891
@saidwho9891 Ай бұрын
writing a Brotli decompressor, it's super interesting
@alexander53
@alexander53 Ай бұрын
very nice
@maksymiliank5135
@maksymiliank5135 29 күн бұрын
Isn't his priority queue implementation broken? He removed the update method with heap.Fix in it
@ErazerPT
@ErazerPT Ай бұрын
You might wanna give "Putting Video on a Floppy Disk" ( kzfaq.info/get/bejne/q62fhZaLvsDVmpc.html ) a look. But fun as it might be, I'd first run the raw data through something that exists like Brotli or some other LZ variant. It just might be good enough... PAQ would probably give better comp, but its so excruciatingly SLOOOOOW it's of no use.
@benjamin7853
@benjamin7853 22 сағат бұрын
I think there is a pun here if you spell it "Trie"
@MrZadeak
@MrZadeak Ай бұрын
Are you excited? I'm excited!
@puneetdhiman5194
@puneetdhiman5194 Ай бұрын
Damn
@airkami
@airkami Ай бұрын
FirstTry-agen
@lex224ification
@lex224ification Ай бұрын
exactly one hour. nice.
@Em0L0rd
@Em0L0rd Ай бұрын
What neovim colorscheme is this?
@bwemery5
@bwemery5 Ай бұрын
also wondering this
@Eyepatch13
@Eyepatch13 28 күн бұрын
I think he uses rose pink
@ravenecho2410
@ravenecho2410 Ай бұрын
First t, second t
@Buddharta
@Buddharta Ай бұрын
Prime is pretty bad at explaining
@vladm6892
@vladm6892 Ай бұрын
For me his explanations work very well. I think it depends on the current level you are actually at, I'm thinking it's hard to target all skill ranges with explanations. Maybe it would help if you provide with your statement some valid points that he could improve on (I don't know if he reads youtube), or maybe it will help others who are trying to pursue teaching. :D
@filiplaubert5001
@filiplaubert5001 Ай бұрын
Well it'd not a react step by step guide. I think he is pretty good
@DerekDoes...
@DerekDoes... Ай бұрын
I understood what he was saying, but also think the explanations weren't the best. It was also made worse by trying to squeeze the content into a tiny space that was obscured by his camera
@Buddharta
@Buddharta Ай бұрын
@@vladm6892 No. The ability of a lecturer to explain things does not depend on what level of knowledge of the audience, thats ridiculous. I been teaching mathematics at university for years so I know where we (the lecturers) fail in measuring the audience level. I've been watching Prime for some time now and hes problems teaching go beyond that. The issues are multiple but to point out one: He is too impatient and fails to introduce the concepts or the steps of the algos propetly (this is what you think can be mitigated by previous knowledge which is somewhat true but is not accetable) and only does half assed examples.
@hitthemill8595
@hitthemill8595 Ай бұрын
Agree, the only time I understand what he's explaining is when I already know what he is talking about.
My Brain after 569 Leetcode Problems
7:50
NeetCode
Рет қаралды 2,4 МЛН
First Realtime App With The Golang Platform
1:10:49
TheVimeagen
Рет қаралды 88 М.
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 63 МЛН
DELETE TOXICITY = 5 LEGENDARY STARR DROPS!
02:20
Brawl Stars
Рет қаралды 18 МЛН
Пробую самое сладкое вещество во Вселенной
00:41
Кушать Хочу
Рет қаралды 4,1 МЛН
СНЕЖКИ ЛЕТОМ?? #shorts
00:30
Паша Осадчий
Рет қаралды 7 МЛН
Tower Defense Against ChatGPT
7:03
TheVimeagen
Рет қаралды 8 М.
2300 Devs vs 1 Dev
39:11
TheVimeagen
Рет қаралды 47 М.
Reacting to Controversial Opinions of Software Engineers
9:18
Fireship
Рет қаралды 2 МЛН
Neovim Is a Waste Of Time, And I LOVE It | Prime Reacts
17:00
ThePrimeTime
Рет қаралды 84 М.
My Initial Impresson Of Go
12:39
TheVimeagen
Рет қаралды 73 М.
ThePrimeagen On Running Linux
9:40
Tech Over Tea
Рет қаралды 193 М.
From Vim To Zed
19:03
ThePrimeTime
Рет қаралды 206 М.
Creating Game Of Life In Neovim
43:55
TheVimeagen
Рет қаралды 22 М.
The New Massively Parallel Language
23:37
ThePrimeTime
Рет қаралды 155 М.
What Makes A Great Developer
27:12
ThePrimeTime
Рет қаралды 139 М.
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 43 МЛН
WWDC 2024 Recap: Is Apple Intelligence Legit?
18:23
Marques Brownlee
Рет қаралды 6 МЛН