Optimal Merge Patterns || Greedy Method || Design and Analysis of Algorithms || DAA

Sudhakar Atchala
Sudhakar Atchala
22.5 هزار بار بازدید - 3 سال پیش - #sudhakaratchala #daavideos
#sudhakaratchala #daavideos #daaplaylist Given n number of sorted files, the task is to find the minimum computations done to reach Optimal Merge Pattern. When two or more sorted files are to be merged all together to form a single file, the minimum computations done to reach this file are known as Optimal Merge Pattern. If more than 2 files need to be merged then it can be done in pairs. For example, if need to merge 4 files A, B, C, D. First Merge A with B to get X1, merge X1 with C to get X2, merge X2 with D to get X3 as the output file. If we have two files of sizes m and n, the total computation time will be m+n. Here, we use greedy strategy by merging two smallest size files among all the files present. Examples: Given 3 files with size 2, 3, 4 units.Find optimal way to combine these files
3 سال پیش در تاریخ 1400/05/02 منتشر شده است.
22,571 بـار بازدید شده
... بیشتر