Odd-even transposition algorithem, Computer Networking

Assignment Help:

Algorithm: Odd-Even Transposition

//Input: N numbers that are in the unsorted form

//Assume that element bi is assigned to pi

for I=1 to N

{

If (I%2 != 0) //i.e Odd phase

{

For j=1,3,5,7,..................2*n/2-1

{

Apply compare-exchange (Pj, Pj+1) //Operation is executed in parallel

}

}

Else // Even phase

{

For j=2,4,6,8..................2*(n-1)/2-1

{

} I++

}

 Apply compare-exchange(Pj, Pj+1) //Operation is executed in parallel

}

Let us take an example and illustrate the odd-even transposition algorithm.

Analysis

The above algorithm needs one „for loop? starting from I=1 to N, i.e. N times and for every value of I, one „for loop? of J is implemented in parallel. Thus, the time difficulty of the algorithm is O (n) as there are total n phases and each phase executes either odd or even transposition in O(1) time.

2417_Example.png

                                                                             Example


Related Discussions:- Odd-even transposition algorithem

What are the tools sued for cryptography and web security, Q. What are the ...

Q. What are the Tools sued for Cryptography and Web Security? Tools - Cryptography VPN - remote access PGP - email Dedicated Circuits -tunnels' - IPSec

Explain radio wave, Explain Radio Wave. Although Radio waves are common...

Explain Radio Wave. Although Radio waves are common and well understood, we are just starting to realize their enormous potential as a networking medium. Radio waves can operat

Show nonreturn to zero encoding, Q. Show Nonreturn to Zero encoding? - ...

Q. Show Nonreturn to Zero encoding? - Value of signal is for all time positive or negative - NRZ-L Signal level depends on bit represented; positive typically means 0

Difference between baseband and broadband transmission, What is difference ...

What is difference between baseband and broadband transmission? In a baseband transmission, the whole bandwidth of the cable is consumed by a one signal. In broadband transmiss

Illustrate about rsa encryption, Q. Illustrate about RSA Encryption? R...

Q. Illustrate about RSA Encryption? RSA Encryption - Public key encryption technique - Encryption steps: - Encode data to be encrypted as a number to create the pla

What is the standard isdn term for a native isdn modem, TA is the standard...

TA is the standard ISDN term for a native ISDN modem

Dns tunneling – domain name server, DNS Tunneling – Domain Name Server ...

DNS Tunneling – Domain Name Server "If, on one system, it is possible to transmit bits to another in any form, and in turn receive a reply as a result of that transmission, th

How is computer networks used in sales and marketing, Q. How is computer ne...

Q. How is computer networks used in sales and marketing?  Marketing and sales:   Computer networks are used extensively in both marketing and sales organizations. Marketing pr

Describe briefly how the news filtering agent works, QUESTION (a) Conce...

QUESTION (a) Concerning agents that reduce workload, there are four agents developed using a learning approach among which is the News Filtering Agent. Name the other three age

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd