huffman-ts
Version:
Huffman ts is an implementation of Huffman Algorithm in Typescript. It provides full compatibility with Huffman algorithm reference.
15 lines (14 loc) • 399 B
TypeScript
/**
* Huffman tree node type:
* 1. [not Leaf node] have left, right child, do not have value
* 2. [Leaf node] do not have left and right, have value
*/
import { HuffmanEncoded } from "./type";
export declare class TreeNode {
left: TreeNode | null;
right: TreeNode | null;
value: string | null;
constructor();
isLeaf(): boolean;
encode(): HuffmanEncoded;
}