Odd-even transposition algorithem, Computer Networking

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

Posted Date: 3/2/2013 6:53:00 AM | Location : United States







Related Discussions:- Odd-even transposition algorithem, Assignment Help, Ask Question on Odd-even transposition algorithem, Get Answer, Expert's Help, Odd-even transposition algorithem Discussions

Write discussion on Odd-even transposition algorithem
Your posts are moderated
Related Questions
Single-cell wireless LAN All of the wireless end systems are within range of a single control module. Multiple-cell wireless LAN: there are many control modules interlinked by

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

How do we do encryption and authentication in L2TP?

What are TP-Lite and TP-Heavy Monitors? Ans) TP-Lite is simply the integration of TP Monitor functions in the database engines.TP-Heavy are TP Monitors which handles the Client/

Q. Advantages of Fiber Optics? - Higher bandwidth in comparison to twisted-pair and coaxial cable is not limited by medium but by equipment used to generate and receive signals

Explain multipoint connection. A multipoint connection is a link among three or more devices. Historically, multipoint connections were used to attach central CPs to distribute

What is CRC The CRC is computed while transmission and appended to output stream as soon as last bit goes out onto wire. If the CRC were in header, it will be necessary to make

In spite of the incompatibilities among networks, researchers have devised a function that gives universal service among heterogeneous networks known 'internetworking'. It uses bot

What are the Internal Threats Internal security problems are probably the most common. One never knows what someone is going to do. Even the most loyal employees or workers can

One of the design requirements is to isolate other network traffic and broadcast from finance department to improve security. In order for this to possible we will implement VLAN o