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 is a web server in client server environment, This new model of Client...

This new model of Client/Server having of thin, portable, "universal" clients that talks to superfast servers. In the simple form, a web server returns documents when clients ask f

What are the two functions of the data link mac layer, a) Manages protocol ...

a) Manages protocol access to the physical network medium b) Permits multiple devices to uniquely signify one another on the data link layer

Maths, the equation x3-6x+9x-5=0

the equation x3-6x+9x-5=0

Show v.32 standard, Q. Show V.32 standard? - ITU-T's V.32 standard was ...

Q. Show V.32 standard? - ITU-T's V.32 standard was issued in 1991 for asynchronous and full-duplex operation at 14.4 Kbps. V.32bis - Is an extension of the V.32 technology?

Connection-oriented service, Sender requests connection from network. Other...

Sender requests connection from network. Other receiver agrees to connection. Computers interchange data through connection. One-endpoint requests network to split connection when

Describe the advantages of intranet to the organisation, Describe the advan...

Describe the advantages of Intranet to the organisation The most obvious advantage is that everyone with access to a computer terminal connected to the Intranet can obtain the

Three main functions at layer three of the osi model, Identify the 3 major ...

Identify the 3 major functions at layer 3 of the OSI model Ans) Layer three explains the path, forwards the packet and executes software / logical addressing.

Determine the connection to backbone lan, Connection to backbone LAN In...

Connection to backbone LAN In most cases, interconnection with stations on a wired backbone LAN is needed. For infrastructure wireless LANs, this is simply accomplished by the

Computer Networking help, Hello, I have a question which is due tomorrow (2...

Hello, I have a question which is due tomorrow (2/15/2013) at 11:55pm. The configuration portion of the exercise has been completed. I only need the questions in bold answered (onl

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