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 short term and medium-term scheduling, What are short, long and med...

What are short, long and medium-term scheduling? Long term scheduler verifies which programs are admitted to the system for processing. It controls the degree of multiprogrammi

When it comes to networking what are rights, When it comes to networking, w...

When it comes to networking, what are rights? Rights refer to the authorized permission to perform exact actions on the network. Every user on the network can be assigned indiv

Debug ip igrp transaction, To monitor IP igrp traffic, we can use "debug IP...

To monitor IP igrp traffic, we can use "debug IP igrp transaction" or "debug IP igrp events". How do we show information about IPX routing update packets? Ans) Bu using debug ip

Explain priority and reservation of token passing, Priority and Reservation...

Priority and Reservation Higher priority stations may possibly access the token sooner Each station has a priority code Since token passes by station waiting to t

Encrypt and decrypt message cryptography, Submission instructions: Answer ...

Submission instructions: Answer the following questions using a text processing software and submit your answers via connex. Possible file formats for your submission file(s) are .

Command to configure a explanation on an interface, Recognize the command t...

Recognize the command to configure a explanation on an interface Ans) Router(config-if)# explanation Finance department

Processor arrangements-array, Processor Arrangements It is a very frequ...

Processor Arrangements It is a very frequent event in data parallel programming to group a number of processors to perform definite tasks. To reach this goal, HPF gives a direc

Physical interfaces that ppp can be configured , Name the physical interfac...

Name the physical interfaces that PPP can be configured on a Cisco router:  Ans) A. Asynchronous serial  B. HSSI  C. ISDN  D. Synchronous serial  These four of th

Determine about the tcp/ip, Determine about the TCP/IP Stands for Tr...

Determine about the TCP/IP Stands for Transmission Control Protocol/Internet Protocol. This is the group of protocols that define the Internet and communication method used

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