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

Explain design issues of interconnection network, Design Issues Of Intercon...

Design Issues Of Interconnection Network Below are the issues, which must be considered when designing an interconnection network. 1)  Size and Dimension of network:  It m

Case study, Scenario: Your Case Study must be based on the information prov...

Scenario: Your Case Study must be based on the information provided. There will be no additional information. This must be submitted in a .doc, or .pdf format. If you send a few

The concept of universal service, The major problems with multiple networks...

The major problems with multiple networks are as given: A computer attached to a given server can only interact with other computers attached to the similar network.

What is the beaconing, An FDDI frame or Token Ring frames those points to s...

An FDDI frame or Token Ring frames those points to serious problem with the ring, like a broken cable. The beacon frame carries the address of the station thought to be down.

What is wdm, What is WDM? WDM is conceptually the similar as FDM, excep...

What is WDM? WDM is conceptually the similar as FDM, except that the multiplexing and demultiplexing includes light signals transmitted by fiber optics channel.

Show the process of mail delivery, Q. Show the process of Mail Delivery? ...

Q. Show the process of Mail Delivery? Mail Delivery -Consists of three stages -First stage - email goes from user agent to local server, where it is stored until it ma

Define the difference among trusted and untrusted networks, Can you define ...

Can you define the difference among trusted and untrusted networks?

Multicast extension to ospf, MOSPF MOSPF is multicast extension to OSP...

MOSPF MOSPF is multicast extension to OSPF. This protocol is extension of OSPF which is a unicast routing protocol which make MOSPF a combination of unicast and multicast prot

What happens in cdma systems, Question: (a) Suppose that you are a comm...

Question: (a) Suppose that you are a communication engineer and you have to construct a mobile telephone network with bandwidth W = 4.2 MHz in each link. The data rate is

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