Skip to content

wise-saint/Optimal_Merging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Optimal_Merging

Optimal merging of different data sets or files.

Optimal merge pattern using greedy approach.

Optimal merge pattern is a greedy method to merge two or more files in the minimum possible time.
To achieve our objective, we start with the two smallest files.
In the next step, we merge the next two smallest files,
including the file that we merged in the previous step.
And, do the same till we get the only one file.

For e.g. suppose we have four files f1, f2, f3 & f4 with sizes 5, 7, 3 & 8 respectively.
Step 1 : Merge f3 (size = 3) & f1 (size = 5), we get f31 (size = 8).
Step 2 : Merge f2 (size = 7) & f4 (size = 8), we get f24 (size = 15).
Step 3 : Merge f31 (size = 8) & f24 (size = 15), we get f3124 (size = 23).

Here's a diagramatic expalanatiion : image

Releases

No releases published

Packages

No packages published

Languages