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
Configure basic switch parameters. Configure the S1, S2, and S3 switches according to the following guidelines: Configure the switch hostname. Disable DNS lookup.

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?

Qustions: Simplify the following expression using a Karnaugh map: F = XY‾Z + X‾Y‾Z + XY Z +X‾ Y Z

Suppose a small company wants to develop a computer network of 18 computers in its main office. Due to limited resources the company wants a network architecture where a single com

Define the Bulletin Board Intranet This type of Intranet in an organisation extends to everyone the capability to review or update information that would normally be placed


Dijkstra Algorithms To calculate its  routing  table  each router applies an algorithm  called  the dijkstra algorithm to its  state database. The dijkstra algorithm  calculate

Bens Network  Ben's network is a non-blocking network.  It is a different  type of Clos network where initial and final stage consists of  2×2 switches (for n input  and m ou

What are the benefits of Networking? The following are the distinct notes in favor of computer networking. a. The computers, staff and information can be well managed b.

What is the difference between routable and non- routable protocols? Ans) Routable protocols can work with a router and can be used to build huge networks. Non-Routable protocol