Presentation is loading. Please wait.

Presentation is loading. Please wait.

Batcher Sorting Network, n = 4

Similar presentations


Presentation on theme: "Batcher Sorting Network, n = 4"— Presentation transcript:

1 Batcher Sorting Network, n = 4

2 Batcher Sorting Network, n = 8

3 Lemma 1 Any subsequence of a sorted sequence is a sorted sequence.
sorted sorted 1 1 1 1 1 1 1 1

4 Lemma 2 For a sorted sequence, the number of 0’s in the even subsequence is either equal to, or one greater than, the number of 0’s in the odd subsequence. sorted 1 1 1 1 1 1 even odd

5 Lemma 3 For two sorted sequences and :
denotes the the number of 0’s in denotes the even subsequence of denotes the odd subsequence of

6 Lemma 3 1 1 1 x 1 E x 1 1 O x

7 Lemma 3 For two sorted sequences and : (by Lemma 2) (by Lemma 2)

8 Merge Network Merge[4] sorted sorted sorted

9 Merge Network (pf.) sorted sorted sorted sorted Merge[4] (by Lemma 1)

10 Merge Network (pf.) sorted sorted Merge[4] By Lemma 3 and
differ by at most 1 By Lemma 3 sorted

11 Merge Network (pf.) Merge[4] sorted and differ by at most 1 By Lemma 3

12 Merge Network (pf.) 1 1 1 1 1 1 Merge[4] By Lemma 3 and
Merge[4] 1 1 and differ by at most 1 By Lemma 3 1 1 1 1

13 Batcher Sorting Network
Merge[8] sorted Sort[4]

14 Batcher Sorting Network, n = 4
Merge[4]

15 Batcher Sorting Network, n = 8
Merge[8] Sort[4]

16 Sorting Networks AKS (Ajtai, Komlós, Szemerédi) Network:
based on expander graphs. AKS (Chvátal) Batcher AKS better for


Download ppt "Batcher Sorting Network, n = 4"

Similar presentations


Ads by Google