Odd-even transposition algorithem, Computer Networking

Assignment Help:

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


Related Discussions:- Odd-even transposition algorithem

What is the standard isdn term for a native isdn modem, TA is the standard...

TA is the standard ISDN term for a native ISDN modem

Importance of implementing a fault tolerance system, What is the importance...

What is the importance of implementing a Fault Tolerance System? Are there limitations? A fault tolerance system makes sure continuous data availability. This is done by elimin

What is load balancing, If the number of incoming clients invokes exceeds t...

If the number of incoming clients invokes exceeds the number of processes in a server class, the TP Monitor might be dynamically start new ones and this is known as Load balancing.

Determine about the security systems, Determine about the Security Systems ...

Determine about the Security Systems If the company intends to connect to the Internet, then it should pay great attention to the configuration of firewalls. Just as no one wo

Checksum - transport layer, Checksum This 16 bits field contain  th...

Checksum This 16 bits field contain  the checksum. The  calculation of the   checksum for TCP follows  the same  procedure as the  described for  UDP. However the inclusion

Describe network topology and vpn, Describe Network Topology and VPN Ne...

Describe Network Topology and VPN Network Topology refers to the layout of a computer network. It presents how devices and cables are physically laid out, as well as how they j

Advantage and disadvantage of wiring schemes, ADVANTAGE AND DISADVANTAGE OF...

ADVANTAGE AND DISADVANTAGE OF WIRING SCHEMES:  Each of three wiring procedure has disadvantages and advantages, which are illustrate as follows: RELIABILITY ISSUES:  W

When would we use isdn, We use IDSN supports high speed voice, data and vid...

We use IDSN supports high speed voice, data and video and is a good choice for many small businesses.

Http is stateless - discuss this statement, Question : (a) Describe, w...

Question : (a) Describe, with the aid of a diagram, a hybrid topology of a network of your choice. (b) Briefly explain the similarity and differences between a switch and

Explain the anonymous ftp, What is anonymous FTP? Anonymous FTP is a wa...

What is anonymous FTP? Anonymous FTP is a way of granting user access to files in public servers. Users that are permitted access to data in these servers do not require identi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd