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
Q. What is Shielded Twisted Pair? - A metal foil or braided-mesh covering encases every pair of insulated conductors to prevent electromagnetic noise called crosstalk - Cros

Network Protocols In computer  networks  communication  occurs between  the entities in different  systems an entity  is anything  that is  capable  of sending  or receiving

Process to send data is called as encapsulation and process to receive data is called De-encapsulation.

TCP Connections TCP  is an end to end point to point  transport  used in internet. being a point  to point  protocols  means that  there is always  s single  sender  a single

CAUSES OF FAILURES Every failure has a well-defined cause.  Any system or device has an inherent strength or capacity to resist failures. This depends on design, material, man

When the computers on the network basically listen and receive the signal, they are referred to as passive due to they don't amplify the signal in any way.

Q. What are the main categories based on which applications of computer network will be categorized? Ans: The main areas under which the applications for computer network will

Q. Show the Congestion control in TCP? Congestion control in TCP TCP assumes that the cause of lost segment is due to congestion in the network Retransmission of

Explain what are the External Threats External security threats are the most problematic ones. Till date the greatest threat was the virus menace. Now, with the sophisticated

Q. What are the Routing Techniques? Routing Routing Techniques Static versus Dynamic Routing Routing Table for classful Addressing Routing Table for Cl