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

Dns records and messages - application layer, DNS Records  and Messages ...

DNS Records  and Messages Two types  of records  are used DNS. The  question records  are used in the question  section of the query and response  messages. The resource  reco

Create the registration request that mh sends to fa, Assume a network as de...

Assume a network as depicted below with a home agent (HA), a foreign agent (FA), a mobile host (MH), and a remote host (RH). The dotted box is the home location of MH. Assume MH's

traffic flow mapping , Develop traffic flow mapping and performance requir...

Develop traffic flow mapping and performance requirements for flows. A) Traffic Flow Mapping B) Performance Requirements

Internet architecture, Company seldom uses a single router to connect its e...

Company seldom uses a single router to connect its entire network for two purpose. Because the router must transmit every packet, the processor in a provided router is insuff

What is a pseudo TTY, What is a pseudo tty? A pseudo tty or false termi...

What is a pseudo tty? A pseudo tty or false terminal enables external machines to connect by Telnet or rlogin. Without a pseudo tty, no connection can take place.

Transmission control protocol, Transmission Control Protocol (TCP) TCP ...

Transmission Control Protocol (TCP) TCP makes the Internet reliable. TCP solves several problems which can occur in a packet switching system. TCP provide the given facilities:

Determine downloading time when non persistent http is used, Assume that a ...

Assume that a user wants to download from a server a web page that references 3 objects. The base page and each of the objects are of the same size that requires 20 ms transmission

What is network architecture, What is Network Architecture? When two o...

What is Network Architecture? When two or more computer are linked with one another for the purpose of communicating data electronically, besides physical connection of comput

Illustrate the products based on socks protocol, Illustrate the products ba...

Illustrate the products based on Socks protocol There are a number of products based on SOCKS specifications such as Auto SOCKS available in the market. The latest version is S

Determine about the tcp/ip and osi model, Determine about the TCP/IP and OS...

Determine about the TCP/IP and OSI model Both models are based on the layered protocols. Both comprise network, transport and application layer. In both the models, transport s

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