CPSC 461: Copyright © 2002 Katrin Becker 1998-2002 Last Modified July 31, 2000 04:21 PM

Cascade Merge

 
This is another way to distribute initial runs for a merge:
- it's another form of K-way merge (using K+1 devices)
 
There are several steps to each phase:
First we do a K-way merge,
then a K-1 way merge,
then a K-2 way merge
.......
till we have one 2-way merge (which we do)
 
 

Device 1
Device 2
Device 3
 
Device k-1
Device k
# of runs
1
0
0
.....
0
0
1
1
1
1
.....
1
1
K
n1
n2
n3
.....
nk-1
nk
.....
n1 + n2
n1
 

 

 

 
Device 1
Device 2
Device 3
Device 4
Device 5
Device 6
initial distribution:
551
501
411
291
151
0
5-way
401
351
261
141
0
155
4-way
261
211
121
0
144
--
3-way
141
91
0
123
--
--
2-way
51
0
92
--
--
--
now..
0
51
92
123
144
155
5-way
515
0
42
73
94
105
4-way
--
414
0
33
54
65
3-way
--
--
312
0
24
35
2-way
--
--
--
29
0
15
now..
515
414
312
29
15
0
5-way
415
314
212
19
0
155
4-way
315
214
112
0
139
--
3-way
215
114
0
141
--
--
2-way
115
0
129
--
--
--
finally..
0
115
129
141
139
155
 
1179
         

 

Perfect Distribution:

Level
Device 1
Device 2
Device 3
Device 4
Device 5
0
1
0
0
0
0
1
1
1
1
1
1
2
5
4
3
2
1
3
15
14
12
9
5
4
55
50
41
29
15
5
190
175
146
105
55
n
an
bn
cn
dn
en
n + 1
an + bn + cn + dn + en
an + bn + cn + dn
an + bn + cn
an + bn
an

 
 
6th Order Tables for:
Cascade Merge
0 1 2 3 4 5 6 total
1 1 1 1 1 1 1 6
2 6 5 4 3 2 1 21
3 21 20 18 15 11 6 91
4 91 85 74 59 41 21 371
5 371 350 309 250 176 91 1547
6 1547 1456 1280 1030 721 371 6405
 
In general, for > 5 tapes the Cascade Merge makes fewer passes than the Fibinacci (Polyphase) Merge


Back to Top
CPSC 461: Copyright © 2002 Katrin Becker 1998-2002 Last Modified July 31, 2000 04:21 PM