Questions tagged [n-way-merge]

7 questions
90
votes
7 answers

DIFF utility works for 2 files. How to compare more than 2 files at a time?

So the utility Diff works just like I want for 2 files, but I have a project that requires comparisons with more than 2 files at a time, maybe up to 10 at a time. This requires having all those files side by side to each other as well. My research…
Javed Ahamed
  • 2,554
  • 5
  • 30
  • 40
5
votes
2 answers

Are there any n-way diff tools with vertical compare?

I started using diffuse, which you can use to compare multiple files together with, but it's some what useless since you can't horizontally compare lines when you have like 20 files you need to compare together, I was thinking maybe one line from…
leeand00
  • 23,306
  • 34
  • 125
  • 265
3
votes
3 answers

Comparing five different sources

I need to write a function which will compare 2-5 "files" (well really 2-5 sets of database rows, but similar concept), and I have no clue of how to do it. The resulting diff should present the 2-5 files side by side. The output should show added,…
Jonas Byström
  • 22,233
  • 21
  • 93
  • 137
1
vote
2 answers

Displaying only the similarities between 20 or so files?

Say I've got a directory full of html pages. Their headers and footers are basically the same, but I want to be able to see only the portions of all the pages that are the same. I'd like to call it an n-way merge, but that isn't what it is, it's…
leeand00
  • 23,306
  • 34
  • 125
  • 265
0
votes
1 answer

Merging K Sorted Lists: Efficiency

I have received a homework that requires me to Merge K sorted lists having a total of N elements into a single sorted list efficiently. The methods that I have stumbled upon are to use a Min-heap to sort the elements from the K lists or use a Divide…
Raz Crimson
  • 177
  • 9
0
votes
0 answers

k-way merge sort python

def left_child(i): return 2*i+1 def right_child(i): return 2*i+2 def kway_merge(elements): Build_heap(elements) sub_array_size = len(elements) sort_Array = [] sort_Array.append(elements[0]) print "Sorted Array in…
vr22
  • 57
  • 3
  • 13
-1
votes
2 answers

Implement algorithm to merge sorted arrays and return it

I have to implement a Java program called Merge.java which contain the following implementation of algorithm: Using the merge procedure for merge sort, merge the first two sorted arrays, then merge in the third,and so on. Given k sorted arrays,…
Ka Mal
  • 145
  • 1
  • 11