Skip to content

Commit e97dcb7

Browse files
committed
fix(huffman): revert frequencies to original in CLRS
1 parent c1a66ef commit e97dcb7

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Some real-world usage of the algorithms to show when they can be applied.
6666
6767
A classic application of this problem is in scheduling a room for multiple competing events, each having its own time requirements (start and end time), and many more arise within the framework of operations research. [Source](https://en.wikipedia.org/wiki/Activity_selection_problem)
6868

69-
### Huffman coding
69+
### Huffman coding 🔡
7070

7171
> A Huffman code is a particular type of optimal prefix code that is commonly used for lossless data compression.
7272

algorithms/misc/huffman/__snapshots__/huffman.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
exports[`Huffman coding tree 1`] = `
44
│ ┌── d:16
55
│ ┌── 30
6-
│ │ │ ┌── f:8
6+
│ │ │ ┌── e:9
77
│ │ └── 14
8-
│ │ └── e:6
8+
│ │ └── f:5
99
│ ┌── 55
1010
│ │ │ ┌── b:13
1111
│ │ └── 25

algorithms/misc/huffman/huffman.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ describe('huffman', () => {
88
{ char: 'b', frequency: 13 },
99
{ char: 'c', frequency: 12 },
1010
{ char: 'd', frequency: 16 },
11-
{ char: 'e', frequency: 6 },
12-
{ char: 'f', frequency: 8 },
11+
{ char: 'e', frequency: 9 },
12+
{ char: 'f', frequency: 5 },
1313
];
1414
const tree = huffman(frequences);
1515

0 commit comments

Comments
 (0)