Huffman Encoding First Try

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 42

  • @nb6175
    @nb6175 6 месяцев назад +41

    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 6 месяцев назад +13

      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... 6 месяцев назад

      Skill issue, should've typed faster.

    • @MorningNapalm
      @MorningNapalm 5 месяцев назад

      There was one who refused to leave the toilet until they had written a certain number of words :D

    • @Arunnn241
      @Arunnn241 4 месяца назад

      @@notuxnobux Been there, still do that.

  • @another212shadow
    @another212shadow 6 месяцев назад +6

    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 6 месяцев назад +2

      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 ;)

  • @theodorealenas3171
    @theodorealenas3171 6 месяцев назад +2

    This looks similar to me doing leetcode style exercises for Uni, but without the skill issues and the starring at the wall.

  • @sr-gt6fk
    @sr-gt6fk 6 месяцев назад +3

    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

  • @musimsek
    @musimsek 6 месяцев назад +10

    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

  • @joga_bonito_aro
    @joga_bonito_aro 6 месяцев назад +4

    THE NAME... The FirstTryAgen!

  • @u9vata
    @u9vata 6 месяцев назад +6

    This algorithm was class material in my high school second year in Hungary 🙂

    • @ramb0lxmb
      @ramb0lxmb 6 месяцев назад

      congrats. this is why hungary is at the forefront of the tech world today.

    • @u9vata
      @u9vata 6 месяцев назад +1

      @@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.

  • @saidwho9891
    @saidwho9891 6 месяцев назад

    writing a Brotli decompressor, it's super interesting

  • @ErazerPT
    @ErazerPT 6 месяцев назад +1

    You might wanna give "Putting Video on a Floppy Disk" ( ruclips.net/video/uGoR3ZYZqjc/видео.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.

  • @MrZadeak
    @MrZadeak 6 месяцев назад +6

    Are you excited? I'm excited!

  • @maksymiliank5135
    @maksymiliank5135 6 месяцев назад

    Isn't his priority queue implementation broken? He removed the update method with heap.Fix in it

  • @lex224ification
    @lex224ification 6 месяцев назад +1

    exactly one hour. nice.

  • @alexander53
    @alexander53 6 месяцев назад

    very nice

  • @airkami
    @airkami 6 месяцев назад

    FirstTry-agen

  • @benjamin7853
    @benjamin7853 5 месяцев назад

    I think there is a pun here if you spell it "Trie"

  • @puneetdhiman5194
    @puneetdhiman5194 6 месяцев назад

    Damn

  • @Em0L0rd
    @Em0L0rd 6 месяцев назад +1

    What neovim colorscheme is this?

    • @bwemery5
      @bwemery5 6 месяцев назад

      also wondering this

    • @Eyepatch13
      @Eyepatch13 6 месяцев назад

      I think he uses rose pink

  • @Buddharta
    @Buddharta 6 месяцев назад +44

    Prime is pretty bad at explaining

    • @vladm6892
      @vladm6892 6 месяцев назад +15

      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 6 месяцев назад +2

      Well it'd not a react step by step guide. I think he is pretty good

    • @DerekDoes...
      @DerekDoes... 6 месяцев назад +3

      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 6 месяцев назад +6

      @@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 6 месяцев назад +7

      Agree, the only time I understand what he's explaining is when I already know what he is talking about.

  • @jamesc2810
    @jamesc2810 3 месяца назад

    Doom… meh, why not make a voxel engine in the terminal and make a terminal version of minecraft. 😂

  • @ravenecho2410
    @ravenecho2410 6 месяцев назад +1

    First t, second t