Skip to content

Commit 17316a7

Browse files
committed
minor
1 parent ce3bb20 commit 17316a7

File tree

1 file changed

+2
-2
lines changed
  • home/4_resource_itineraries/2_CN_Data_Structures_and_OOP/5._Data_Structures/3._Auxilary_Data_Structures/3._Tries

1 file changed

+2
-2
lines changed

home/4_resource_itineraries/2_CN_Data_Structures_and_OOP/5._Data_Structures/3._Auxilary_Data_Structures/3._Tries/4._Huffman_Encoding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BTW, we do concatenation here, not frequency (number) and code.
99

1010
Note:
1111
- There are versions of thinking about encoding:
12-
1. Fixed size + concatenated. ineffecient.
12+
1. Fixed size + concatenated. inefficient.
1313
2. Fixed size code + frequency (not concatenating the same char). equally inefficient as above, asymptotically.
1414
3. Variable sized + frequency (not possible) ❌
1515
4. Variable sized + concatenation. ✅
@@ -21,7 +21,7 @@ Note:
2121
This is a technique for text compression. **Remember that this compression(text) has to be lossless.**
2222

2323
## Huffman algorithm (generating prefix tree)
24-
- Huffman encoding tries to reduce the space requirement for the most ocurring characters. If some rare character(s) need to space greater than 1 bytes, it will be okay, since they are so less.
24+
- Huffman encoding tries to reduce the space requirement for the most occurring characters. If some rare character(s) need to space greater than 1 bytes, it will be okay, since they are so less.
2525
- Basically we are using different length of bits for each letter. i.e not 8 bits for each letter.
2626
- Note that prefixes for a code cannot be the code for some other character. This happens because, in case of codes with same prefixes, when we reach a letter, the next node **is** a number, **not** a letter and vice-versa. i.e all parents are numbers(sum of frequencies of children).
2727

0 commit comments

Comments
 (0)