SlideShare a Scribd company logo
1 of 6
Download to read offline
SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016
ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 103
Huffman Text Compression Technique
Suherman1
, Andysah Putera Utama Siahaan2
Faculty of Computer Science
Universitas Pembanguan Panca Budi
Jl. Jend. Gatot Subroto Km. 4,5 Sei Sikambing, 20122, Medan, Sumatera Utara, Indonesia
Abstract— Huffman is one of the compression
algorithms. It is the most famous algorithm to
compress text. There are four phases in the Huffman
algorithm to compress text. The first is to group the
characters. The second is to build the Huffman tree.
The third is the encoding, and the last one is the
construction of coded bits. The Huffman algorithm
principle is the character that often appears on
encoding with a series of short bits and characters
that rarely appeared in bit-encoding with a longer
series. Huffman compression technique can provide
savings of 30% from the original bits. It works based
on the frequency of characters. The more the similar
character reached, the higher the compression rate
gained.
Keywords— Huffman, Compression, Algorithm,
Security
I. INTRODUCTION
A text is a collection of characters or strings into a
single unit. It contains many characters in it that
always cause problems in limited storage device and
speed of data transmission at the particular time.
Although storage can be replaced by another larger
one, this in not a good solution if there is another
solution. And this is making everyone try to think to
find a way that can be used to compress text.
Compression is the process of changing the original
data into code form to save storage and time
requirements for data transmission.A loseless
compression algorithm should emphasize the
originality of the data during compression and
decompression process[5].By using the Huffman
algorithm, text compression process is done by using
the principle of the encoding; each character is
encoded with a series of several bits to produce a more
optimal result. The purpose of writing this paper is to
investigate the effectiveness and the shortest way of
the Huffman algorithm in the compression of text and
explain the ways of compressing text using Huffman
algorithm in programming.
II. THEORIES
Data Compression is the process of shrinking data
to smaller bits than the original representation so that
it takes less storage space and less transmission time
while communicating over a network [2]. Huffman
algorithm was created by an MIT student named
David Huffman in 1952. It is one of the oldest
methods and most famous in text compression [5].
The Huffman code uses the principles similar to
Morse code. Each character is encoded only with a
few bits series, where characters that often appear with
a coded series of short bits and characters that rarely
appears is encoded with a longer set of bits. Based on
the type of map, the code is used to change the initial
message (the contents of the input data) into a set of
codeword‟s. Huffman algorithm uses static methods. A
static method is a method that always uses the same
code map but the sequence of character appearance
can be changed. This method requires two step. The
first step to calculate the frequency of occurrence of
each symbol and determine the map code, and the last
is to convert the message into a collection of code that
will be transmitted. Meanwhile, based on symbols
coding technique, Huffman uses the symbol wise
method. Symbol wise is a method that calculates the
frequncy of the characters in every
process.Tranforming text characters into symbolwise
is not an easy process [3]. The symbol is more often
occur will be given shorter code than the symbols that
rarely appears.
A. Greedy Algorithm
Greedy Algorithm solves a problem by selecting the
best distance at the particular time. Huffman problems
can be solved using a greedy algorithm as well [4]. A
greedy algorithm is an algorithm which follows the
problem-solving metaheuristic of making the optimum
choice. By calculating each step, the optimal solution
is resolved. For example, applying the greedy strategy
to the TSP to visit the nearest unvisited place.Greedy
algorithm never finds the global solution. This
algorithm is good at finding the nearest solution. Two
of the examples of greedy algorithms are Kruskal's
and Prim's algorithm.
B. The Relationship to Huffman Algorithm.
David Huffman encoded character by simply using
an ordinary binary tree, but after that, David Huffman
found that using a greedy algorithm can establish the
optimal prefix code. The use of greedy algorithm on
Huffman is at the election of two trees with the lowest
frequency in a Huffman tree. A greedy algorithm is
used to minimize the total cost. Cost is used to merge
SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016
ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 104
two trees at the root of frequency equal to the number
two fruit trees that are combined. Therefore the total
cost of the establishment of the Huffman tree is the
total of the whole merger. Therefore, the Huffman
algorithm is one example of compression algorithm
that uses the greedy algorithm. Our goal is to calculate
the total cost incurred to establish the text.
III. IMPLEMENTATION
Thissection tries to figure out the Huffman
technique. There are four steps must be accomplished
to make the Huffman technique is fully operated.
These phases below explain the steps of its algorithm.
A. Phase One.
Assume the sentence is “LIKA-LIKU LAKI-LAKI
TAK LAKU-LAKU”. The text above is 33 length. It
must be categorized base on the character frequency.
The Character_Set function is to determine how many
times each character appears.
function Character_Set(text : string) :
string;
var
temp : string;
result : string;
begin
temp := text;
result := '';
for i := 1 to length(temp) do
for j := i + 1 to length(temp) do
if temp[i] = temp[j] then temp[j] :=
'#';
j := 1;
for i := 1 to length(temp) do
if temp[i] <> '#' then
begin
result := concat(result, temp[i]);
inc(j);
end;
Character_Set := result;
end;
The first loop which is done by “for” is to replace
the duplicate character into „#‟. The second loop
removes the original text that consists of „#‟. The
illustration is showed below.
Original Text : LIKA-LIKU LAKI-LAKI TAK
LAKU-LAKU
Replaced Text : LIKA-###U
##########T############
Character Set : LIKA-U T
procedure Character_Freq(text : string);
var
temp : string;
freq : byte;
begin
temp := Character_Set(text);
for i := 1 to length(temp) do
begin
freq := 0;
for j := 1 to length(text) do
if temp[i] = text[j] then inc(freq);
AddNode(Head, Tail, temp[i], freq);
end;
end;
The above procedure calculates the frequency of
the character occurrence. First, the character set
function must be run to obtain a series of a single
character used; then the first character until the last
character must be compared to the original text to get
the frequency. The result will be sent to the node after
getting incremented. Figure 1 illustrates the characters
and their frequency obtain from Phase One.
Fig. 1 Unsorted character and frequency
The table must be sorted in ascending order and the
primary key is the frequency.
procedure Tree_Sorting;
var
tASCII : char;
tFreq : byte;
begin
for i := length(cs) - 1 downto 1 do
begin
Current := Head;
for j := 1 to i do
begin
if Current^.Freq > Current^.Next^.Freq
then
begin
tASCII := Current^.ASCII;
tFreq := Current^.Freq;
Current^.ASCII := Current^.Next^.ASCII;
Current^.Freq := Current^.Next^.Freq;
Current^.Next^.ASCII := tASCII;
Current^.Next^.Freq := tFreq;
end;
Current := Current^.Next;
end;
end;
end;
The procedure above is to sort the unsorted list by
using bubble sort algorithm. The first node will be
compared to the next node, and the larger value will
be swapped and moved to the right. Figure 2
SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016
ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 105
demonstrates the result after the sort.
Fig. 2 Character and frequency after sorted
B. Phase Two.
After the table is fully sorted, it is time to face the
most difficult step; that is to make the Huffman tree.
Each node must be categorized and put it on the linked
list. The Greedy algorithm takes apart at this section.
It needs to combine two nodes and make a new node
and make it as a parent of those earlier nodes. Let‟s
see the illustration below:
T - U I L A K
1 3 3 3 4 6 6 7
Draw the first two nodes, and release from the
table. Make a new node which will be their parent.
* U * I L A K
4 3 3 4 4 6 6 7
T -
1 3
The parent node will be inserted to the table in
ascending order using insertion algorithm. The first
node is now replaced by the third node before.
Moreover, It has to do the same way again until the
table consists of one node.
* * I * L A K
6 4 4 6 6 6 7
U
3 3
* * L A K *
8 6 6 6 7 8
* I
4 4
* A K * *
12 6 7 8 12
* L
6 6
* * * *
13 8 12 13
A K
6 7
* * *
20 13 20
* *
8 12
* *
33 33
* *
13 20
T - U * I L A K
1 3 3 3 4 4 6 6 7
T - U * I * L A K
1 3 3 3 4 4 6 6 6 7
T - U * I * L A K *
1 3 3 3 4 4 6 6 6 7 8
T - U * I * L A K * *
1 3 3 3 4 4 6 6 6 7 8 12
T - U * I * L A K * * *
1 3 3 3 4 4 6 6 6 7 8 12 13
T - U * I * L A K * * * *
1 3 3 3 4 4 6 6 6 7 8 12 13 20
T - U * I * L A K * * * * *
1 3 3 3 4 4 6 6 6 7 8 12 13 20 33
Finally, the array consists of 15 nodes.
In this step, there are two modelsof tree.
- Double Linked List.
- Binary Tree Linked List.
Fig. 3Double & Binary Tree Linked List
Figure 3 shows the hierarchy of the array. The *
indicates the node has a parent. Figure 4 is the
SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016
ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 106
complete diagram of the Huffman tree.
Fig.4Huffman Tree
The aim using two models of linked list is to avoid
the searching procedures. The search can be either
breadth-first or depth-first search to form the bit code,
but it takes time and advanced programming
technique. However, a list can be used to replace the
backtracking procedure. The procedure track what the
parent is.
procedure Huffman_Tree;
var
tFreq : byte;
tASCII : char;
InsertN : NodeP;
NewNode : NodeP;
begin
tASCII := '*';
Current := Head;
while Current^.Next <> NIL do
begin
InsertN := Head;
tFreq := Current^.Freq +
Current^.Next^.Freq;
Current^.Bit := 0;
Current^.Next^.Bit := 1;
while InsertN <> NIL do
begin
if tFreq <= InsertN^.Freq then
begin
new(NewNode);
NewNode^.Freq := tFreq;
NewNode^.ASCII := tASCII;
NewNode^.Next := InsertN;
NewNode^.Prev := InsertN^.Prev;
InsertN^.Prev^.Next := NewNode;
InsertN^.Prev := NewNode;
NewNode^.Left := Current;
NewNode^.Right := Current^.Next;
Current^.Parent := NewNode;
Current^.Next^.Parent := NewNode;
break;
end
else if tFreq > Tail^.Freq then
begin
new(NewNode);
NewNode^.Freq := tFreq;
NewNode^.ASCII := tASCII;
Tail^.Next := NewNode;
NewNode^.Prev := Tail;
Tail:=NewNode;
Tail^.Next := NIL;
NewNode^.Left := Current;
NewNode^.Right := Current^.Next;
Current^.Parent := NewNode;
Current^.Next^.Parent := NewNode;
break;
end;
InsertN := InsertN^.Next;
end;
Current := Current^.Next;
Current := Current^.Next;
end;
end;
Huffman Tree procedure is used to form the
Huffman tree by processing the earlier linear tree.The
nodes must be marked “what is on the left” and “what
is on the right”. It is done by adding a sign 0 or 1 to
the node field.
type
NodeP = ^Node;
Node = record
ASCII : char;
Bit : byte;
Code : string;
Dec : byte;
freq : byte;
Prev,
Next : NodeP;
Parent,
Left,
Right : NodeP;
end;
ASCII : where character is
memorized.
Bit : node sign. (left or right)
Code : Huffman code.
Dec : decimal code.
Freq : occurence of the
character.
Next, Prev,
Parent,
Left, Right : represent the connected
nodes.
The first two nodes must be combined. The first
node will be marked as „0‟ since it is on the left and
the second node will be marked as „1‟ since it is one
the right. Moreover, both nodes have the same parent,
and the parent has two children, the nodes. After the
parent node is created, it must be inserted into the
linked list by combining the value of the node and the
value of the linked list. The node must be added to the
left of the larger or same value. However, if the parent
node is greater than every node, it has to be inserted
after the last node.
C. Phase Three.
In this step, the tree is already structured. It is time
to retrieve the node sign by making a loop until the
SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016
ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 107
parent of the last node is empty (null).
procedure Write_Huffman;
var
result : string;
bit : string[1];
begin
Current := Head;
repeat
result := '';
Cursor := Current;
Current^.Dec := 0;
Biner := 1;
if Cursor^.ASCII <> '*' then
begin
repeat
if (Cursor^.Bit = 0) or
(Cursor^.Bit = 1) then
begin
Current^.Dec := Current^.Dec +
(Cursor^.Bit * Biner);
Biner := Biner * 2;
str(Cursor^.Bit, Bit);
insert(Bit, result, 1);
end;
Cursor := Cursor^.Parent;
until Cursor^.Parent = NIL;
end;
Current^.Code := result;
Current := Current^.Next;
until Current^.Next = NIL;
end;
The nodes which are not parents are retrieved.
Moreover, the node sign from the node will be
inserted into a single string.
D. Phase Four.
Each node has consisted of code. This phase,
everything that has been coded is converted to a
Huffman table. Table 1 shows the priority of
characters. The character “K” has the most appearance
while the character “T” has the less one.Characters
with the highest emergence is having the shortest
binary code.
TABLE IHUFFMAN TABLE
Char Freq. Code Bit Len. Code Len.
T 1 1000 4 4
- 3 1001 4 12
U 3 1100 4 12
3 1101 4 12
I 4 101 3 12
L 6 111 3 18
A 6 00 2 12
K 7 01 2 14
96
Each code represents the character. It consists of a
few digit of the binary string. The previous text will be
transformed into the new binary set. The old eight-bit
binary is replaced by the new one. Let‟s see the
example below:
Original Text : LIKA-LIKU LAKI-LAKI TAK
LAKU-LAKU
Original Code :
111 101 01 00 1001 111 101 01 1100 1101
111 00 01 101 1001 111 00 01 101 1101 1000
00 01 1101 111 00 01 1100 1001 111 00 01
1100
Bit Code :
11110101 00100111110101110011011110001101
100111100011011101100000 0111011110001110
01001111 00011100
Decimal Code :
254, 39, 215, 55, 141, 158,
55, 96, 119, 142, 79, 28
Fig. 5Running Program (Part. 1)
Fig. 6Running Program (Part. 2)
Fig. 7Running Program (Part. 3)
SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016
ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 108
Figure 5 to Figure 7 are the Huffman running
processes. The original text before compression takes
33 characters length. Sooner after being compressed,
the string only takes 12 characters. It saved 21
characters.
The illustration:
Original Text Length : 33
Coded Text Length : 12
Saving Rate : (33 – 12) / 33 *
100 %
63.63636 %
By doing this algorithm, the compression rate
achieves 63% of the original message. Of course, it
will save the storage capacity.
IV. CONCLUSION
This research should explain the basic technique on
how to implement the compression algorithm.
Huffman algorithm can combine with the greedy
algorithm which always find the easiest ways from the
nearest node. There are four phases in the Huffman
algorithm to compress a text; the first is the phase to
manage and get the frequency of the character. The
second is the formation of the Huffman tree; the third
is to form the code from the node sign. Moreover, the
last phase is the encoding process. However, in this
paper, the author only perform the encoding method,
the decoding is under a project. Applying Huffman in
compression will again more space in the storage.
Huffman encoding is very powerful to the text
message which has similar character occurrence.
REFERENCES
[1] A. Malik, N. Goyat and V. Saroha, "Greedy Algorithm:
Huffman Algorithm," International Journal of Advanced
Research in Computer Science and Software Engineering,
vol. 3, no. 7, pp. 296-303, 2013.
[2] A. S. Sidhu and M. Garg, "Research Paper on Text Data
Compression Algorithm using Hybrid Approach," IJCSMC,
vol. 3, no. 12, pp. 1-10, 2014.
[3] H. Al-Bahadili and S. M. Hussain, "A Bit-level Text
Compression Scheme Based on the ACW Algorithm,"
International Journal of Automation and Computing, pp. 123-
131, 2010.
[4] I. Akman, H. Bayindir, S. Ozleme, Z. Akin and a. S. Misra,
"Lossless Text Compression Technique Using Syllable Based
Morphology," International Arab Journal of Information
Technology, vol. 8, no. 1, pp. 66-74, 2011.
[5] M. Schindler, "Practical Huffman coding," 1998. [Online].
Available: http://www.compressconsult.com/huffman/.

More Related Content

What's hot

AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...
AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...
AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...IJCSEA Journal
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)bolovv
 
String in python lecture (3)
String in python lecture (3)String in python lecture (3)
String in python lecture (3)Ali ŮŤSattar
 
Cwkaa 2010
Cwkaa 2010Cwkaa 2010
Cwkaa 2010Sam Neaves
 
Interpolation wikipedia
Interpolation   wikipediaInterpolation   wikipedia
Interpolation wikipediahort34
 
Lossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDALossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDAIOSR Journals
 
A Comparison of Serial and Parallel Substring Matching Algorithms
A Comparison of Serial and Parallel Substring Matching AlgorithmsA Comparison of Serial and Parallel Substring Matching Algorithms
A Comparison of Serial and Parallel Substring Matching Algorithmszexin wan
 
R programming Language
R programming LanguageR programming Language
R programming LanguageSarthakBhargava7
 
Lab Seminar 2009 06 17 Description Based Ad Hoc Networks
Lab Seminar 2009 06 17  Description Based Ad Hoc NetworksLab Seminar 2009 06 17  Description Based Ad Hoc Networks
Lab Seminar 2009 06 17 Description Based Ad Hoc Networkstharindanv
 
Pattern matching programs
Pattern matching programsPattern matching programs
Pattern matching programsakruthi k
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4Introduction To Programming with Python-4
Introduction To Programming with Python-4Syed Farjad Zia Zaidi
 
Program structure
Program structureProgram structure
Program structureAlex Shkotin
 
Introduction to Data Structures & Algorithms
Introduction to Data Structures & AlgorithmsIntroduction to Data Structures & Algorithms
Introduction to Data Structures & AlgorithmsAfaq Mansoor Khan
 
C1320prespost
C1320prespostC1320prespost
C1320prespostFALLEE31188
 

What's hot (15)

AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...
AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...
AN ALGORITHM FOR OPTIMIZED SEARCHING USING NON-OVERLAPPING ITERATIVE NEIGHBOR...
 
Chapter Three(2)
Chapter Three(2)Chapter Three(2)
Chapter Three(2)
 
String in python lecture (3)
String in python lecture (3)String in python lecture (3)
String in python lecture (3)
 
Cwkaa 2010
Cwkaa 2010Cwkaa 2010
Cwkaa 2010
 
Interpolation wikipedia
Interpolation   wikipediaInterpolation   wikipedia
Interpolation wikipedia
 
Lossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDALossless LZW Data Compression Algorithm on CUDA
Lossless LZW Data Compression Algorithm on CUDA
 
A Comparison of Serial and Parallel Substring Matching Algorithms
A Comparison of Serial and Parallel Substring Matching AlgorithmsA Comparison of Serial and Parallel Substring Matching Algorithms
A Comparison of Serial and Parallel Substring Matching Algorithms
 
R programming Language
R programming LanguageR programming Language
R programming Language
 
Lab Seminar 2009 06 17 Description Based Ad Hoc Networks
Lab Seminar 2009 06 17  Description Based Ad Hoc NetworksLab Seminar 2009 06 17  Description Based Ad Hoc Networks
Lab Seminar 2009 06 17 Description Based Ad Hoc Networks
 
Pattern matching programs
Pattern matching programsPattern matching programs
Pattern matching programs
 
Introduction To Programming with Python-4
Introduction To Programming with Python-4Introduction To Programming with Python-4
Introduction To Programming with Python-4
 
Program structure
Program structureProgram structure
Program structure
 
Introduction to Data Structures & Algorithms
Introduction to Data Structures & AlgorithmsIntroduction to Data Structures & Algorithms
Introduction to Data Structures & Algorithms
 
C1320prespost
C1320prespostC1320prespost
C1320prespost
 
Final3
Final3Final3
Final3
 

Similar to Huffman Text Compression Technique

Combining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcherCombining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcherIAEME Publication
 
Implementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text DataImplementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text DataBRNSSPublicationHubI
 
A Survey of String Matching Algorithms
A Survey of String Matching AlgorithmsA Survey of String Matching Algorithms
A Survey of String Matching AlgorithmsIJERA Editor
 
Text compression
Text compressionText compression
Text compressionSammer Qader
 
Discrete structure ch 3 short question's
Discrete structure ch 3 short question'sDiscrete structure ch 3 short question's
Discrete structure ch 3 short question'shammad463061
 
User_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docxUser_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docxdickonsondorris
 
Data communication & computer networking: Huffman algorithm
Data communication & computer networking:  Huffman algorithmData communication & computer networking:  Huffman algorithm
Data communication & computer networking: Huffman algorithmDr Rajiv Srivastava
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmDr Sandeep Kumar Poonia
 
Theory of algorithms final
Theory of algorithms final Theory of algorithms final
Theory of algorithms final Dgech
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftAlexanderCominsky
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxskilljiolms
 
Parallel random projection using R high performance computing for planted mot...
Parallel random projection using R high performance computing for planted mot...Parallel random projection using R high performance computing for planted mot...
Parallel random projection using R high performance computing for planted mot...TELKOMNIKA JOURNAL
 
11.the novel lossless text compression technique using ambigram logic and huf...
11.the novel lossless text compression technique using ambigram logic and huf...11.the novel lossless text compression technique using ambigram logic and huf...
11.the novel lossless text compression technique using ambigram logic and huf...Alexander Decker
 
Securing Mobile Technology Of Gsm Using A5/1 Algorithm
Securing Mobile Technology Of Gsm Using A5/1 AlgorithmSecuring Mobile Technology Of Gsm Using A5/1 Algorithm
Securing Mobile Technology Of Gsm Using A5/1 AlgorithmIRJET Journal
 
IRJET-Securing Mobile Technology Of Gsm Using A5/1 Algorithm
IRJET-Securing Mobile Technology Of Gsm Using A5/1 AlgorithmIRJET-Securing Mobile Technology Of Gsm Using A5/1 Algorithm
IRJET-Securing Mobile Technology Of Gsm Using A5/1 AlgorithmIRJET Journal
 
Genetic Algorithm Based Cryptographic Approach using Karnatic Music
Genetic Algorithm Based Cryptographic Approach using  Karnatic  MusicGenetic Algorithm Based Cryptographic Approach using  Karnatic  Music
Genetic Algorithm Based Cryptographic Approach using Karnatic MusicIRJET Journal
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings MethodsMr Examples
 

Similar to Huffman Text Compression Technique (20)

report
reportreport
report
 
Combining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcherCombining text and pattern preprocessing in an adaptive dna pattern matcher
Combining text and pattern preprocessing in an adaptive dna pattern matcher
 
Implementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text DataImplementation of Lossless Compression Algorithms for Text Data
Implementation of Lossless Compression Algorithms for Text Data
 
A Survey of String Matching Algorithms
A Survey of String Matching AlgorithmsA Survey of String Matching Algorithms
A Survey of String Matching Algorithms
 
Text compression
Text compressionText compression
Text compression
 
Discrete structure ch 3 short question's
Discrete structure ch 3 short question'sDiscrete structure ch 3 short question's
Discrete structure ch 3 short question's
 
User_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docxUser_42751212015Module1and2pagestocompetework.pdf.docx
User_42751212015Module1and2pagestocompetework.pdf.docx
 
Data communication & computer networking: Huffman algorithm
Data communication & computer networking:  Huffman algorithmData communication & computer networking:  Huffman algorithm
Data communication & computer networking: Huffman algorithm
 
Sunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithmSunzip user tool for data reduction using huffman algorithm
Sunzip user tool for data reduction using huffman algorithm
 
Theory of algorithms final
Theory of algorithms final Theory of algorithms final
Theory of algorithms final
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
 
Philippe Oechslin
Philippe OechslinPhilippe Oechslin
Philippe Oechslin
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
Parallel random projection using R high performance computing for planted mot...
Parallel random projection using R high performance computing for planted mot...Parallel random projection using R high performance computing for planted mot...
Parallel random projection using R high performance computing for planted mot...
 
11.the novel lossless text compression technique using ambigram logic and huf...
11.the novel lossless text compression technique using ambigram logic and huf...11.the novel lossless text compression technique using ambigram logic and huf...
11.the novel lossless text compression technique using ambigram logic and huf...
 
Securing Mobile Technology Of Gsm Using A5/1 Algorithm
Securing Mobile Technology Of Gsm Using A5/1 AlgorithmSecuring Mobile Technology Of Gsm Using A5/1 Algorithm
Securing Mobile Technology Of Gsm Using A5/1 Algorithm
 
IRJET-Securing Mobile Technology Of Gsm Using A5/1 Algorithm
IRJET-Securing Mobile Technology Of Gsm Using A5/1 AlgorithmIRJET-Securing Mobile Technology Of Gsm Using A5/1 Algorithm
IRJET-Securing Mobile Technology Of Gsm Using A5/1 Algorithm
 
Genetic Algorithm Based Cryptographic Approach using Karnatic Music
Genetic Algorithm Based Cryptographic Approach using  Karnatic  MusicGenetic Algorithm Based Cryptographic Approach using  Karnatic  Music
Genetic Algorithm Based Cryptographic Approach using Karnatic Music
 
Python Strings Methods
Python Strings MethodsPython Strings Methods
Python Strings Methods
 
Huffman
HuffmanHuffman
Huffman
 

More from Universitas Pembangunan Panca Budi

Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...
Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...
Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...Universitas Pembangunan Panca Budi
 
An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa
An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa
An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa Universitas Pembangunan Panca Budi
 
Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...
Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...
Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...Universitas Pembangunan Panca Budi
 
Insecure Whatsapp Chat History, Data Storage and Proposed Security
Insecure Whatsapp Chat History, Data Storage and Proposed SecurityInsecure Whatsapp Chat History, Data Storage and Proposed Security
Insecure Whatsapp Chat History, Data Storage and Proposed SecurityUniversitas Pembangunan Panca Budi
 
Prim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on GraphPrim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on GraphUniversitas Pembangunan Panca Budi
 
Multi-Attribute Decision Making with VIKOR Method for Any Purpose Decision
Multi-Attribute Decision Making with VIKOR Method for Any Purpose DecisionMulti-Attribute Decision Making with VIKOR Method for Any Purpose Decision
Multi-Attribute Decision Making with VIKOR Method for Any Purpose DecisionUniversitas Pembangunan Panca Budi
 
Mobile Application Detection of Road Damage using Canny Algorithm
Mobile Application Detection of Road Damage using Canny AlgorithmMobile Application Detection of Road Damage using Canny Algorithm
Mobile Application Detection of Road Damage using Canny AlgorithmUniversitas Pembangunan Panca Budi
 
Super-Encryption Cryptography with IDEA and WAKE Algorithm
Super-Encryption Cryptography with IDEA and WAKE AlgorithmSuper-Encryption Cryptography with IDEA and WAKE Algorithm
Super-Encryption Cryptography with IDEA and WAKE AlgorithmUniversitas Pembangunan Panca Budi
 
Technique for Order Preference by Similarity to Ideal Solution as Decision Su...
Technique for Order Preference by Similarity to Ideal Solution as Decision Su...Technique for Order Preference by Similarity to Ideal Solution as Decision Su...
Technique for Order Preference by Similarity to Ideal Solution as Decision Su...Universitas Pembangunan Panca Budi
 
Prototype Application Multimedia Learning for Teaching Basic English
Prototype Application Multimedia Learning for Teaching Basic EnglishPrototype Application Multimedia Learning for Teaching Basic English
Prototype Application Multimedia Learning for Teaching Basic EnglishUniversitas Pembangunan Panca Budi
 
TOPSIS Method Application for Decision Support System in Internal Control for...
TOPSIS Method Application for Decision Support System in Internal Control for...TOPSIS Method Application for Decision Support System in Internal Control for...
TOPSIS Method Application for Decision Support System in Internal Control for...Universitas Pembangunan Panca Budi
 
Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...
Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...
Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...Universitas Pembangunan Panca Budi
 
Violations of Cybercrime and the Strength of Jurisdiction in Indonesia
Violations of Cybercrime and the Strength of Jurisdiction in IndonesiaViolations of Cybercrime and the Strength of Jurisdiction in Indonesia
Violations of Cybercrime and the Strength of Jurisdiction in IndonesiaUniversitas Pembangunan Panca Budi
 
Marketing Strategy through Markov Optimization to Predict Sales on Specific P...
Marketing Strategy through Markov Optimization to Predict Sales on Specific P...Marketing Strategy through Markov Optimization to Predict Sales on Specific P...
Marketing Strategy through Markov Optimization to Predict Sales on Specific P...Universitas Pembangunan Panca Budi
 
Prim's Algorithm for Optimizing Fiber Optic Trajectory Planning
Prim's Algorithm for Optimizing Fiber Optic Trajectory PlanningPrim's Algorithm for Optimizing Fiber Optic Trajectory Planning
Prim's Algorithm for Optimizing Fiber Optic Trajectory PlanningUniversitas Pembangunan Panca Budi
 
A Review of IP and MAC Address Filtering in Wireless Network Security
A Review of IP and MAC Address Filtering in Wireless Network SecurityA Review of IP and MAC Address Filtering in Wireless Network Security
A Review of IP and MAC Address Filtering in Wireless Network SecurityUniversitas Pembangunan Panca Budi
 
Expert System of Catfish Disease Determinant Using Certainty Factor Method
Expert System of Catfish Disease Determinant Using Certainty Factor MethodExpert System of Catfish Disease Determinant Using Certainty Factor Method
Expert System of Catfish Disease Determinant Using Certainty Factor MethodUniversitas Pembangunan Panca Budi
 

More from Universitas Pembangunan Panca Budi (20)

Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...
Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...
Application of Data Encryption Standard and Lempel-Ziv-Welch Algorithm for Fi...
 
An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa
An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa
An Implementation of a Filter Design Passive LC in Reduce a Current Harmonisa
 
Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...
Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...
Simultaneous Response of Dividend Policy and Value of Indonesia Manufacturing...
 
Insecure Whatsapp Chat History, Data Storage and Proposed Security
Insecure Whatsapp Chat History, Data Storage and Proposed SecurityInsecure Whatsapp Chat History, Data Storage and Proposed Security
Insecure Whatsapp Chat History, Data Storage and Proposed Security
 
Online Shoppers Acceptance: An Exploratory Study
Online Shoppers Acceptance: An Exploratory StudyOnline Shoppers Acceptance: An Exploratory Study
Online Shoppers Acceptance: An Exploratory Study
 
Prim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on GraphPrim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on Graph
 
Multi-Attribute Decision Making with VIKOR Method for Any Purpose Decision
Multi-Attribute Decision Making with VIKOR Method for Any Purpose DecisionMulti-Attribute Decision Making with VIKOR Method for Any Purpose Decision
Multi-Attribute Decision Making with VIKOR Method for Any Purpose Decision
 
Mobile Application Detection of Road Damage using Canny Algorithm
Mobile Application Detection of Road Damage using Canny AlgorithmMobile Application Detection of Road Damage using Canny Algorithm
Mobile Application Detection of Road Damage using Canny Algorithm
 
Super-Encryption Cryptography with IDEA and WAKE Algorithm
Super-Encryption Cryptography with IDEA and WAKE AlgorithmSuper-Encryption Cryptography with IDEA and WAKE Algorithm
Super-Encryption Cryptography with IDEA and WAKE Algorithm
 
Technique for Order Preference by Similarity to Ideal Solution as Decision Su...
Technique for Order Preference by Similarity to Ideal Solution as Decision Su...Technique for Order Preference by Similarity to Ideal Solution as Decision Su...
Technique for Order Preference by Similarity to Ideal Solution as Decision Su...
 
Prototype Application Multimedia Learning for Teaching Basic English
Prototype Application Multimedia Learning for Teaching Basic EnglishPrototype Application Multimedia Learning for Teaching Basic English
Prototype Application Multimedia Learning for Teaching Basic English
 
TOPSIS Method Application for Decision Support System in Internal Control for...
TOPSIS Method Application for Decision Support System in Internal Control for...TOPSIS Method Application for Decision Support System in Internal Control for...
TOPSIS Method Application for Decision Support System in Internal Control for...
 
Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...
Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...
Combination of Levenshtein Distance and Rabin-Karp to Improve the Accuracy of...
 
Violations of Cybercrime and the Strength of Jurisdiction in Indonesia
Violations of Cybercrime and the Strength of Jurisdiction in IndonesiaViolations of Cybercrime and the Strength of Jurisdiction in Indonesia
Violations of Cybercrime and the Strength of Jurisdiction in Indonesia
 
Marketing Strategy through Markov Optimization to Predict Sales on Specific P...
Marketing Strategy through Markov Optimization to Predict Sales on Specific P...Marketing Strategy through Markov Optimization to Predict Sales on Specific P...
Marketing Strategy through Markov Optimization to Predict Sales on Specific P...
 
Prim's Algorithm for Optimizing Fiber Optic Trajectory Planning
Prim's Algorithm for Optimizing Fiber Optic Trajectory PlanningPrim's Algorithm for Optimizing Fiber Optic Trajectory Planning
Prim's Algorithm for Optimizing Fiber Optic Trajectory Planning
 
Image Similarity Test Using Eigenface Calculation
Image Similarity Test Using Eigenface CalculationImage Similarity Test Using Eigenface Calculation
Image Similarity Test Using Eigenface Calculation
 
Data Compression Using Elias Delta Code
Data Compression Using Elias Delta CodeData Compression Using Elias Delta Code
Data Compression Using Elias Delta Code
 
A Review of IP and MAC Address Filtering in Wireless Network Security
A Review of IP and MAC Address Filtering in Wireless Network SecurityA Review of IP and MAC Address Filtering in Wireless Network Security
A Review of IP and MAC Address Filtering in Wireless Network Security
 
Expert System of Catfish Disease Determinant Using Certainty Factor Method
Expert System of Catfish Disease Determinant Using Certainty Factor MethodExpert System of Catfish Disease Determinant Using Certainty Factor Method
Expert System of Catfish Disease Determinant Using Certainty Factor Method
 

Recently uploaded

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 

Recently uploaded (20)

Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1CĂłdigo Creativo y Arte de Software | Unidad 1
CĂłdigo Creativo y Arte de Software | Unidad 1
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 

Huffman Text Compression Technique

  • 1. SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016 ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 103 Huffman Text Compression Technique Suherman1 , Andysah Putera Utama Siahaan2 Faculty of Computer Science Universitas Pembanguan Panca Budi Jl. Jend. Gatot Subroto Km. 4,5 Sei Sikambing, 20122, Medan, Sumatera Utara, Indonesia Abstract— Huffman is one of the compression algorithms. It is the most famous algorithm to compress text. There are four phases in the Huffman algorithm to compress text. The first is to group the characters. The second is to build the Huffman tree. The third is the encoding, and the last one is the construction of coded bits. The Huffman algorithm principle is the character that often appears on encoding with a series of short bits and characters that rarely appeared in bit-encoding with a longer series. Huffman compression technique can provide savings of 30% from the original bits. It works based on the frequency of characters. The more the similar character reached, the higher the compression rate gained. Keywords— Huffman, Compression, Algorithm, Security I. INTRODUCTION A text is a collection of characters or strings into a single unit. It contains many characters in it that always cause problems in limited storage device and speed of data transmission at the particular time. Although storage can be replaced by another larger one, this in not a good solution if there is another solution. And this is making everyone try to think to find a way that can be used to compress text. Compression is the process of changing the original data into code form to save storage and time requirements for data transmission.A loseless compression algorithm should emphasize the originality of the data during compression and decompression process[5].By using the Huffman algorithm, text compression process is done by using the principle of the encoding; each character is encoded with a series of several bits to produce a more optimal result. The purpose of writing this paper is to investigate the effectiveness and the shortest way of the Huffman algorithm in the compression of text and explain the ways of compressing text using Huffman algorithm in programming. II. THEORIES Data Compression is the process of shrinking data to smaller bits than the original representation so that it takes less storage space and less transmission time while communicating over a network [2]. Huffman algorithm was created by an MIT student named David Huffman in 1952. It is one of the oldest methods and most famous in text compression [5]. The Huffman code uses the principles similar to Morse code. Each character is encoded only with a few bits series, where characters that often appear with a coded series of short bits and characters that rarely appears is encoded with a longer set of bits. Based on the type of map, the code is used to change the initial message (the contents of the input data) into a set of codeword‟s. Huffman algorithm uses static methods. A static method is a method that always uses the same code map but the sequence of character appearance can be changed. This method requires two step. The first step to calculate the frequency of occurrence of each symbol and determine the map code, and the last is to convert the message into a collection of code that will be transmitted. Meanwhile, based on symbols coding technique, Huffman uses the symbol wise method. Symbol wise is a method that calculates the frequncy of the characters in every process.Tranforming text characters into symbolwise is not an easy process [3]. The symbol is more often occur will be given shorter code than the symbols that rarely appears. A. Greedy Algorithm Greedy Algorithm solves a problem by selecting the best distance at the particular time. Huffman problems can be solved using a greedy algorithm as well [4]. A greedy algorithm is an algorithm which follows the problem-solving metaheuristic of making the optimum choice. By calculating each step, the optimal solution is resolved. For example, applying the greedy strategy to the TSP to visit the nearest unvisited place.Greedy algorithm never finds the global solution. This algorithm is good at finding the nearest solution. Two of the examples of greedy algorithms are Kruskal's and Prim's algorithm. B. The Relationship to Huffman Algorithm. David Huffman encoded character by simply using an ordinary binary tree, but after that, David Huffman found that using a greedy algorithm can establish the optimal prefix code. The use of greedy algorithm on Huffman is at the election of two trees with the lowest frequency in a Huffman tree. A greedy algorithm is used to minimize the total cost. Cost is used to merge
  • 2. SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016 ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 104 two trees at the root of frequency equal to the number two fruit trees that are combined. Therefore the total cost of the establishment of the Huffman tree is the total of the whole merger. Therefore, the Huffman algorithm is one example of compression algorithm that uses the greedy algorithm. Our goal is to calculate the total cost incurred to establish the text. III. IMPLEMENTATION Thissection tries to figure out the Huffman technique. There are four steps must be accomplished to make the Huffman technique is fully operated. These phases below explain the steps of its algorithm. A. Phase One. Assume the sentence is “LIKA-LIKU LAKI-LAKI TAK LAKU-LAKU”. The text above is 33 length. It must be categorized base on the character frequency. The Character_Set function is to determine how many times each character appears. function Character_Set(text : string) : string; var temp : string; result : string; begin temp := text; result := ''; for i := 1 to length(temp) do for j := i + 1 to length(temp) do if temp[i] = temp[j] then temp[j] := '#'; j := 1; for i := 1 to length(temp) do if temp[i] <> '#' then begin result := concat(result, temp[i]); inc(j); end; Character_Set := result; end; The first loop which is done by “for” is to replace the duplicate character into „#‟. The second loop removes the original text that consists of „#‟. The illustration is showed below. Original Text : LIKA-LIKU LAKI-LAKI TAK LAKU-LAKU Replaced Text : LIKA-###U ##########T############ Character Set : LIKA-U T procedure Character_Freq(text : string); var temp : string; freq : byte; begin temp := Character_Set(text); for i := 1 to length(temp) do begin freq := 0; for j := 1 to length(text) do if temp[i] = text[j] then inc(freq); AddNode(Head, Tail, temp[i], freq); end; end; The above procedure calculates the frequency of the character occurrence. First, the character set function must be run to obtain a series of a single character used; then the first character until the last character must be compared to the original text to get the frequency. The result will be sent to the node after getting incremented. Figure 1 illustrates the characters and their frequency obtain from Phase One. Fig. 1 Unsorted character and frequency The table must be sorted in ascending order and the primary key is the frequency. procedure Tree_Sorting; var tASCII : char; tFreq : byte; begin for i := length(cs) - 1 downto 1 do begin Current := Head; for j := 1 to i do begin if Current^.Freq > Current^.Next^.Freq then begin tASCII := Current^.ASCII; tFreq := Current^.Freq; Current^.ASCII := Current^.Next^.ASCII; Current^.Freq := Current^.Next^.Freq; Current^.Next^.ASCII := tASCII; Current^.Next^.Freq := tFreq; end; Current := Current^.Next; end; end; end; The procedure above is to sort the unsorted list by using bubble sort algorithm. The first node will be compared to the next node, and the larger value will be swapped and moved to the right. Figure 2
  • 3. SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016 ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 105 demonstrates the result after the sort. Fig. 2 Character and frequency after sorted B. Phase Two. After the table is fully sorted, it is time to face the most difficult step; that is to make the Huffman tree. Each node must be categorized and put it on the linked list. The Greedy algorithm takes apart at this section. It needs to combine two nodes and make a new node and make it as a parent of those earlier nodes. Let‟s see the illustration below: T - U I L A K 1 3 3 3 4 6 6 7 Draw the first two nodes, and release from the table. Make a new node which will be their parent. * U * I L A K 4 3 3 4 4 6 6 7 T - 1 3 The parent node will be inserted to the table in ascending order using insertion algorithm. The first node is now replaced by the third node before. Moreover, It has to do the same way again until the table consists of one node. * * I * L A K 6 4 4 6 6 6 7 U 3 3 * * L A K * 8 6 6 6 7 8 * I 4 4 * A K * * 12 6 7 8 12 * L 6 6 * * * * 13 8 12 13 A K 6 7 * * * 20 13 20 * * 8 12 * * 33 33 * * 13 20 T - U * I L A K 1 3 3 3 4 4 6 6 7 T - U * I * L A K 1 3 3 3 4 4 6 6 6 7 T - U * I * L A K * 1 3 3 3 4 4 6 6 6 7 8 T - U * I * L A K * * 1 3 3 3 4 4 6 6 6 7 8 12 T - U * I * L A K * * * 1 3 3 3 4 4 6 6 6 7 8 12 13 T - U * I * L A K * * * * 1 3 3 3 4 4 6 6 6 7 8 12 13 20 T - U * I * L A K * * * * * 1 3 3 3 4 4 6 6 6 7 8 12 13 20 33 Finally, the array consists of 15 nodes. In this step, there are two modelsof tree. - Double Linked List. - Binary Tree Linked List. Fig. 3Double & Binary Tree Linked List Figure 3 shows the hierarchy of the array. The * indicates the node has a parent. Figure 4 is the
  • 4. SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016 ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 106 complete diagram of the Huffman tree. Fig.4Huffman Tree The aim using two models of linked list is to avoid the searching procedures. The search can be either breadth-first or depth-first search to form the bit code, but it takes time and advanced programming technique. However, a list can be used to replace the backtracking procedure. The procedure track what the parent is. procedure Huffman_Tree; var tFreq : byte; tASCII : char; InsertN : NodeP; NewNode : NodeP; begin tASCII := '*'; Current := Head; while Current^.Next <> NIL do begin InsertN := Head; tFreq := Current^.Freq + Current^.Next^.Freq; Current^.Bit := 0; Current^.Next^.Bit := 1; while InsertN <> NIL do begin if tFreq <= InsertN^.Freq then begin new(NewNode); NewNode^.Freq := tFreq; NewNode^.ASCII := tASCII; NewNode^.Next := InsertN; NewNode^.Prev := InsertN^.Prev; InsertN^.Prev^.Next := NewNode; InsertN^.Prev := NewNode; NewNode^.Left := Current; NewNode^.Right := Current^.Next; Current^.Parent := NewNode; Current^.Next^.Parent := NewNode; break; end else if tFreq > Tail^.Freq then begin new(NewNode); NewNode^.Freq := tFreq; NewNode^.ASCII := tASCII; Tail^.Next := NewNode; NewNode^.Prev := Tail; Tail:=NewNode; Tail^.Next := NIL; NewNode^.Left := Current; NewNode^.Right := Current^.Next; Current^.Parent := NewNode; Current^.Next^.Parent := NewNode; break; end; InsertN := InsertN^.Next; end; Current := Current^.Next; Current := Current^.Next; end; end; Huffman Tree procedure is used to form the Huffman tree by processing the earlier linear tree.The nodes must be marked “what is on the left” and “what is on the right”. It is done by adding a sign 0 or 1 to the node field. type NodeP = ^Node; Node = record ASCII : char; Bit : byte; Code : string; Dec : byte; freq : byte; Prev, Next : NodeP; Parent, Left, Right : NodeP; end; ASCII : where character is memorized. Bit : node sign. (left or right) Code : Huffman code. Dec : decimal code. Freq : occurence of the character. Next, Prev, Parent, Left, Right : represent the connected nodes. The first two nodes must be combined. The first node will be marked as „0‟ since it is on the left and the second node will be marked as „1‟ since it is one the right. Moreover, both nodes have the same parent, and the parent has two children, the nodes. After the parent node is created, it must be inserted into the linked list by combining the value of the node and the value of the linked list. The node must be added to the left of the larger or same value. However, if the parent node is greater than every node, it has to be inserted after the last node. C. Phase Three. In this step, the tree is already structured. It is time to retrieve the node sign by making a loop until the
  • 5. SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016 ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 107 parent of the last node is empty (null). procedure Write_Huffman; var result : string; bit : string[1]; begin Current := Head; repeat result := ''; Cursor := Current; Current^.Dec := 0; Biner := 1; if Cursor^.ASCII <> '*' then begin repeat if (Cursor^.Bit = 0) or (Cursor^.Bit = 1) then begin Current^.Dec := Current^.Dec + (Cursor^.Bit * Biner); Biner := Biner * 2; str(Cursor^.Bit, Bit); insert(Bit, result, 1); end; Cursor := Cursor^.Parent; until Cursor^.Parent = NIL; end; Current^.Code := result; Current := Current^.Next; until Current^.Next = NIL; end; The nodes which are not parents are retrieved. Moreover, the node sign from the node will be inserted into a single string. D. Phase Four. Each node has consisted of code. This phase, everything that has been coded is converted to a Huffman table. Table 1 shows the priority of characters. The character “K” has the most appearance while the character “T” has the less one.Characters with the highest emergence is having the shortest binary code. TABLE IHUFFMAN TABLE Char Freq. Code Bit Len. Code Len. T 1 1000 4 4 - 3 1001 4 12 U 3 1100 4 12 3 1101 4 12 I 4 101 3 12 L 6 111 3 18 A 6 00 2 12 K 7 01 2 14 96 Each code represents the character. It consists of a few digit of the binary string. The previous text will be transformed into the new binary set. The old eight-bit binary is replaced by the new one. Let‟s see the example below: Original Text : LIKA-LIKU LAKI-LAKI TAK LAKU-LAKU Original Code : 111 101 01 00 1001 111 101 01 1100 1101 111 00 01 101 1001 111 00 01 101 1101 1000 00 01 1101 111 00 01 1100 1001 111 00 01 1100 Bit Code : 11110101 00100111110101110011011110001101 100111100011011101100000 0111011110001110 01001111 00011100 Decimal Code : 254, 39, 215, 55, 141, 158, 55, 96, 119, 142, 79, 28 Fig. 5Running Program (Part. 1) Fig. 6Running Program (Part. 2) Fig. 7Running Program (Part. 3)
  • 6. SSRG International Journal of Computer Science and Engineering (SSRG-IJCSE) – volume 3 Issue 8–August 2016 ISSN: 2348 – 8387 www.internationaljournalssrg.org Page 108 Figure 5 to Figure 7 are the Huffman running processes. The original text before compression takes 33 characters length. Sooner after being compressed, the string only takes 12 characters. It saved 21 characters. The illustration: Original Text Length : 33 Coded Text Length : 12 Saving Rate : (33 – 12) / 33 * 100 % 63.63636 % By doing this algorithm, the compression rate achieves 63% of the original message. Of course, it will save the storage capacity. IV. CONCLUSION This research should explain the basic technique on how to implement the compression algorithm. Huffman algorithm can combine with the greedy algorithm which always find the easiest ways from the nearest node. There are four phases in the Huffman algorithm to compress a text; the first is the phase to manage and get the frequency of the character. The second is the formation of the Huffman tree; the third is to form the code from the node sign. Moreover, the last phase is the encoding process. However, in this paper, the author only perform the encoding method, the decoding is under a project. Applying Huffman in compression will again more space in the storage. Huffman encoding is very powerful to the text message which has similar character occurrence. REFERENCES [1] A. Malik, N. Goyat and V. Saroha, "Greedy Algorithm: Huffman Algorithm," International Journal of Advanced Research in Computer Science and Software Engineering, vol. 3, no. 7, pp. 296-303, 2013. [2] A. S. Sidhu and M. Garg, "Research Paper on Text Data Compression Algorithm using Hybrid Approach," IJCSMC, vol. 3, no. 12, pp. 1-10, 2014. [3] H. Al-Bahadili and S. M. Hussain, "A Bit-level Text Compression Scheme Based on the ACW Algorithm," International Journal of Automation and Computing, pp. 123- 131, 2010. [4] I. Akman, H. Bayindir, S. Ozleme, Z. Akin and a. S. Misra, "Lossless Text Compression Technique Using Syllable Based Morphology," International Arab Journal of Information Technology, vol. 8, no. 1, pp. 66-74, 2011. [5] M. Schindler, "Practical Huffman coding," 1998. [Online]. Available: http://www.compressconsult.com/huffman/.