Showing posts with label Greedy Approach. Show all posts
Showing posts with label Greedy Approach. Show all posts

Huffman Coding | Greedy Method | ADA

 Huffman Coding


It is a Greedy Approach.It is an compression technique used to encode compress data. It is used for reducing the size of data of message. If we store the data on the file than we need compression to reduce the size of file. 
When the the data is send over a network than the data is compress and send to reduce the cost of transmission.

ANALYSIS DESIGN OF ALGORITHM | OPTIMAL MERGE PROBLEM USING GREEDY APPROACH

📌Highlights: Hi friends ! In this I am going to explain about Optimal Merge Problem using Greedy Approach. In this post I covered what is optimal merge problem? , How this approach work to solve the problem?, Examples.


This approach is very simple. In this approach we simply merge those set of files / elements which have smaller values.it follow optimal search pattern.


For understanding Optimal Merge Problem, Let we understand simple merging.

Suppose if we have two shorted list. Marge these two list and create a third list.

ANALYSIS DESIGN OF ALGORITHM (ADA) | MINIMUM SPANNING TREE (MST) USING GREEDY APPROACH


 
📌Highlights: Hi friends ! In this post I am going to explain about Minimum Spanning tree using greedy approach such Prim's and Kruskal's algorithm in Analysis Design of Algorithm.

Let we first understand , what is spanning tree ?

A sub graph suppose S of graph G having V vertices and E edges is said to be spanning tree if following properties must be satisfied.

1. S must contain all vertices of G.

2. S must contain (|V|-1) edges.

3. There is no close loop inside S.

Analysis Design Of Algorithm (ADA) | Job Sequencing with timeline Using Greedy Approach

📌Highlights: Hi friends! In this post I am  going to explain about Job Sequencing with timeline problem using Greedy approach. I am try to explain with the help of examples.


Let we discuss about Job sequencing problem. This is a maximisation problem means If we have so many jobs with their respective profit and timeline. We try to arrange jobs in such a way that we will get more profit and here we must careful about timeline because timeline is like a constraint that we must follow the given time line for respective job.

Analysis Design Of Algorithm (ADA) | Knapsack Problem Using Greedy Approach

📌Highlights: Hi friends! In this post I am  going to explain about Knapsack problem using Greedy approach. I am try to explain with the help of examples.

Knapsack Problem is an application of Greedy Strategy / Method. By Knapsack problem we will find maximum profit. There are so many solution to solve any problem but we will select those solution which generate maximum profit.

Let here we see what the knapsack problem says by the help of an example.

Suppose we have some objects and every object is associated to some profit(p) and weight (w).