Text Compression
Text Compression
Text Compression
using
Huffman code
DESIGN & ANALYSIS OF ALGORITHM
~ BY
Amee Desai
[12202080501072]
PROBLEM SOLVING
ALGORITHM
• Overview
• Diff erent
methods
• Application
• pros
• cons
Problem Solving Algorithm
1. Divide and Conquer
Example: Merge Sort, Binary Search
2. Dynamic Programming
Example: Fibonacci Series, Longest Common Subsequence
3. Greedy Algorithm
Example: Huffman Coding, Activity Selection Problem
4. Backtracking
Example: N-Queens Problem, Sudoku
5. Brute Force
Example: Finding max value in an array, Checking if number is
prime
6. Recursion
Example: Factorial, Fibonacci Series
GreeMethod
dy
• I n t ro d u c t i o n
- Fe a s i b l e s o l u t i o n
-Optimal solution
• How to use
• Re a l l i f e a p p l i c a t i o n
• p ro s
• cons
Greedy
↓ method
APPLICATIONS ↓
• KNAPSACK PROBLEM
• JOB SEQUENCING
• M I N I M U M S PA N N I N G T R E E
• O P T I M A L M E R G E PAT T E R N
• HUFFMAN CODE
• DIJKASTRA ALGORITHM
HUFFMAN CODE
• Overview
• comparison
with other
methods
• How encoding
is done
• How to decode
at the
receiver’s end
AS
CODE
• Overview
• Encoding
CII
decoding
FIXED
APPROACH
LENGTH
Step-
HUFFM
CODE
1 AN 3
Step-
Step- Step-
2 4
Thank You