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. Explain Silly window syndrome? When either sending application sends data gradually or receiving application consumes data slowly - Illustration when 1 byte sent 40 bytes

State the Steps to provide more computing power In order to provide more computing power, the following steps may be taken: Add more processing power by addition of more

details of delta routing??


Q. Describe about Data Communications? - Data - Information presented in whatsoever form is agreed upon by the parties creating and using the data - Data Communications - ex

Question : a) Explain why pervasive computing can be termed as a "technology that disappears". b) List and briefly explain four main components of a MOTE used in Wireless

The diagram below offers an overall view on the methods use by both the OSI and TCP/IP model. ISO Approach - Occasionally called Horizontal Approach - OSI asse

As configuring of VLANs helps in controlling the size of broadcast domains. There are some key components of inter-VLAN routing such as VLAN capable switch Router Ro

I have a project on Information Communication Technology(I.C.T). So sir I want to know that what is internet? and how it works?

Determine the uses of firewalls The firewalls available today do all the things, viz., like filter the data packets, provide proxy services and do stateful inspection of packet