OEMergeSort - unsorted input A complete 8-input sorting...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Batcher’s Networks for Merging / Sorting L H max(a , b) b min(a , b) a Compare-exchange operation Building Block Comparator
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L H L H L H a a a a Sorted c c c c Sorted 2x2 O-E merging Network # of comparators = 3 depth, delay or time = 2 ( length of the longest path from input to an output )
Background image of page 2
L H L H L H 36 14 7 1 12 7 3 1 4x4 O-E merging Network # of comparators = (3 + 3) + 3 = 9 time required = 2 + 1 = 3 L H L H L H 25 18 12 3 36 25 18 14 L H L H L H Sorted Sorted 1 3 7
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L H L H L H L H L H L H L H 4x4 Merging Network 4x4 Merging Network odd even 8x8 Batcher’s Odd-Even Merging Network # of comparators = 2 * 9 + 7 = 25 time required = 3 + 1 = 4 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 y 1 y 2 y 3 y 4 y 5 y 6 y 7 y 8 z 1 z 2 z 3 z 4 z 5 z 6 z 7 z 8 z 9 z 10 z 11 z 12 z 13 z 14 z 15 z 16 Sorted Sorted
Background image of page 4
L H L H L H L H (m/2)x(m/2) Merging Network (m/2)x(m/2) Merging Network odd even a 1 a 2 a 3 a 4 a m b 1 b 2 b 3 b 4 b m-1 b m e 1 e 2 z 3 e 4 e 5 e 2i e 2i+1 e 2m -1 e 2m c 1 c 2 d 1 d 2 d m c m c i+1 d i Recursive Construction B sorted A sorted
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
What About Sorting? Sort by repeated mergers Merger Sorted Output Size 1x1 2 2x2 4 4x4 8 ( n /2)x( n /2) n
Background image of page 6
L H L H 2x2 merg. netw. L H L H 2x2 merg. netw. 4x4 merg. netw. sorted output
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: unsorted input A complete 8-input sorting network Odd-Even Recursive Constrution of an Odd-Even Sorter Length m Sorter Length m Sorter m x m O-E Merger unsorted n / 2 unsorted n / 2 sorted n Sorter Depth D s ( n ) = D s ( n /2) + D m ( n ) D s (2) = 1 D s ( n ) = ((1 + log n ) log n ) / 2 = O ( log 2 n ) log n Odd-Even Merge / Sort ) 1 ( ) 1 )(log (log 4 1 ) 2 ( and ) ( ) 2 ( 2 ) ( 2 log ) log 1 ( ) ( 1 ) 2 ( and ) ( ) 2 ( ) ( 1 2 log 2 ) ( 1 ) 2 ( and 1 2 ) 2 ( 2 ) ( log ) ( 1 ) 2 ( and 1 ) 2 ( ) (-+-⇒ = + = + = ⇒ = + = + = ⇒ =-+ = = ⇒ = + = n n n n C n C n C n C n n n D D n D n D n D n n n C C n n C n C n n D D n D n D S M S S S S M S S M M M M M M M M...
View Full Document

This note was uploaded on 05/12/2010 for the course CS CDA 5110- taught by Professor Deo during the Spring '10 term at University of Central Florida.

Page1 / 9

OEMergeSort - unsorted input A complete 8-input sorting...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online