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 is the difference among  flow control and error control?    Ans) Flow control: adjust and confirm data flow rate for successful transmission. Error Control: a method to

state the advantages of the ICT

Elaborate the term - Database Connectivity Basic connectivity A number of database management systems are available today such as the Oracle, Sybase, Ingres, etc. Most

Internet Client Control Task A distributed system is to be implemented using networked PCs. The role of the system in this task is to implement an environmental control sys

802.11 Architecture ESS (Extended service set) two or more BSSs with APs connected through a distribution system (wired LAN) in an infrastructure network

Control Flow: Once the client has established a network connection with a server, the server must instantiate a new, empty, BasicEnrollmentManager implementation for this client,


Problem 1 Bring out the differences between POP and IMAP4 Problem 2 Discuss User Datagram protocol Problem 3 Explain the various steps in TCP congestion control

This code properly implements the IP checksum function on a 32-bit machine: unsigned short cksum(unsigned short *buf, int count) { unsigned long sum = 0; while (count--) { sum += *

INTRODUCTION In this part, the topic of performance evaluation shows those parameters that are devised to calculate the performances of various parallel systems. Achieving the