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
What are the advantages of bus topology? The benefit of physical bus topology is: a. It uses established standards and it is relatively simple to install. b. It needs les

What is uniform delivery time A uniform delivery time is required for voice, so amount of jitter in net- work is significant. This could be expressed as standard deviation of d


Q. Show Ethernet Media standard? - The cables and connector specifications utilized to support Ethernet implementations are derived from the EIA/TIA (Electronic Industries Asso

What are the working of software team The software team has to learn every bit of things related to computers. Since different users work on different platforms and application

What is the difference between trigger and rule? The triggers are known as implicitly by database generated events, whereas stored procedures are known as explicitly by client

What are the key elements of protocols? The key elements of protocols are a. Syntax   It refers to the structure or format of the data that is the order in which they a

What is Synchronous TDM? In STDM, the multiplexer allocates exactly the same time slot to every device at all times, whether or not a device has anything to transmit.

Question: a) Briefly describe how the file system is organized in Unix. b) What is the importance of the "touch" command. Give one of its disadvantage. c) Name three d

different framing methods