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

Determine the objectives of computer security, Determine the Objectives of ...

Determine the Objectives of computer security Though computerisation helps a lot in proper organisation of experience, it also opens a Pandora's Box simultaneously. On one

Show the process of mail delivery, Q. Show the process of Mail Delivery? ...

Q. Show the process of Mail Delivery? Mail Delivery -Consists of three stages -First stage - email goes from user agent to local server, where it is stored until it ma

Describe about the term- network, Describe about the term- network If n...

Describe about the term- network If network tends to lose the packets, it is better to acknowledge each one of them separately, so the lost packets could be retransmitted. On t

Explain about nonboundary-level masking, Q. Explain about Nonboundary-Level...

Q. Explain about Nonboundary-Level Masking? Nonboundary-Level Masking Bytes in the IP address that correspond to 255 in the mask will be repeated in the subnet addres

What is a jam signal, What is a jam signal A jam signal is broadcasts ...

What is a jam signal A jam signal is broadcasts to network by the transmitting stations that detected the collision to ensure that all stations know of the collision. Every st

Network design with configuration, hi. this is 700 words assignment..how mu...

hi. this is 700 words assignment..how much charges will be for this..?

Research, I have a research in this topic " Mitigating DoS Attacks against ...

I have a research in this topic " Mitigating DoS Attacks against Broadcast Authentication in Wireless Sensor Networks " with simulation

Describe about cryptography, Q. Describe about Cryptography? - Some med...

Q. Describe about Cryptography? - Some media cannot be protected from unauthorized reception (or interception) - Encryption involves transforming the original information in

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