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
- Ackermann function
- Elevator simulator
- Binary workshop
- Binary versus linear search
- The Collatz problem
- Inside a CPU
- Swap the inside
- Function rooms in 3D
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps