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

Integrated services digital network service, The entire idea of ISDN is to ...

The entire idea of ISDN is to digitize the telephone network to allow the transmission of video, audio and text over existing telephone lines. The reason of the ISDN is to provide

What are the fundamentals of intranet, Fundamentals of intranet Introd...

Fundamentals of intranet Introduction The history of the Intranet starts right from the days when computer networks came in. However, it could find a name and place for it

What are the advantages of adaptive routing, What are the Advantages of ada...

What are the Advantages of adaptive routing  (1) An adaptive routing method can improve performance, as realised by the network user. (2) An adaptive routing method can aid

Default cdp broadcast update rate for cisco routers, What is the default CD...

What is the default CDP broadcast update rate for Cisco routers? Ans) Cisco Discovery Protocol is a proprietary protocol to permit you to access configuration information on oth

Security and reciprocity of RSA, Q. Security and Reciprocity of RSA? S...

Q. Security and Reciprocity of RSA? Security and Reciprocity of RSA - Kp and N are issued publicly. - Ks is kept secret. - Since the snooper does not know p and

Multiplexing assignment help, What is multiplexing and demultiplexing? Expl...

What is multiplexing and demultiplexing? Explain. Describe Time division, Frequency division and Wavelength division multiplexing. What is ADSL? How does it use multiplexi

Link state packet - network layer and routing , Link State Packet When ...

Link State Packet When  a router floods  the network  with information about its  neighbourhood. It is said to  be advertising. The basis of this  advertising is  a short  pack

What is an interrupt request, Question: a) Briefly describe the purpos...

Question: a) Briefly describe the purpose of Windows Powershell? b) Name three ways software can be installed on Linux? c) What is an interrupt request? d) As the

What is horizontal and vertical parity, What is horizontal and vertical par...

What is horizontal and vertical parity A single error can cause both horizontal and vertical parity checks to be wrong. Two errors can also be easily detected. If they are not

What are the two functions of the data link mac layer, a) Manages protocol ...

a) Manages protocol access to the physical network medium b) Permits multiple devices to uniquely signify one another on the data link layer

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