Skip to content
All apps

Huffman Coding Step by Step

About this app

The Huffman tree grows from the character frequencies of a text: the two lightest nodes leave the heap, fly under a new node carrying their sum, and the new node returns via heappush. The app computes exactly like the slide code (heapq with __lt__), also for your own text. Then read the codes, see 61 instead of 133 bits for KLEINERBEISPIELTEXT, and decode the bit stream without separators bit by bit through the tree. With a prediction question and a switch for a different choice on ties.

Subject: Computer science

More from Computer science

A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps