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.


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.



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
how tcp is redefined for wireless network

DVMRP • Distance vector multicast routing protocol: Distance vector multicast routing protocol are abbreviated as DVMRP. These protocols are suitable for small networks which

10Base-FL: Fiber Link Ethernet Utilizes star topology to connect stations to a hub External transceiver entitle as a fiber-optic MAU connects processing device to fib

How can I identify the difference types of networks

Q. Illustrate the Advantages of VLANs? - Cost and time reduction in moving stations from one group to another - Creation of virtual workgroups - Security Position of

Cross Bar : The crossbar network is simplest interconnection network. It has a double dimensional grid of switches.  It's a Non-blocking network and offers connectivity between out

The address for a device as it is recognized at the Media Access Control (MAC) layer in the network architecture. MAC address is usually stored in ROM on the network adapter card a

What is a File server? File servers are helpful for sharing files across a network. With a file server, the client passes requests for file records over system to file server.

Question 1 Write short notes on Reserved IP addresses and Special use IP addresses 2 Explain about the packet switching mechanism based on Virtual Circuit 3 Explain about

What is difference between Baseband and Broadband Transmission in ccna? Ans) In a baseband transmission, the entire bandwidth of the cable is consumed by a one signal. In bro