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

State the network environment of intranets and internet, State the Network ...

State the Network environment of Intranets and Internet Intranets as well as the Internet are based purely on networks, the company intending to install Intranet must consider

Explain the diffrent types of security attacks, Q. Explain the diffrent typ...

Q. Explain the diffrent types of Security Attacks? Types of Security Attacks Passive Threats: - Traffic Analysis and - Release of Message Contents Active

Dns cache poisoning, DNS cache poisoning The DNA cache poisoning gener...

DNS cache poisoning The DNA cache poisoning generally refers to the process of maintaining or developing the false information, in the cache of DNS server. This process refers

What is a link, What is a Link? A link refers to the connectivity among...

What is a Link? A link refers to the connectivity among two devices. It contains the type of cables and protocols used in order for single device to be able to communicate with

State the latest technology in the line of intranet, State the latest techn...

State the latest technology in the line of Intranet The latest technology in the line of Intranet tools has been the Web-based Distributed Authoring and Versioning (WebDAV), w

Encoding process, Encoding Process c= uG u: binary da...

Encoding Process c= uG u: binary data sequence of length 4( input) G: Generator matrix which is 7*4 c: Codeword     D

Command Necessary to enter the extended ping command , Determine the comman...

Determine the command mode necessary to enter the extended ping command Ans) Router#

Program annotation packages, A fairly renowned approach in this area is Ope...

A fairly renowned approach in this area is OpenMP, a recently developed industry standard for shared memory programming on architectures with uniform memory access characteristics.

What is ipv6 addressing, QUESTION (a) What are the problems with IPv4 o...

QUESTION (a) What are the problems with IPv4 on today's Internet and how does IPv6 solve these problems? (b) Describe at least three ways in which IPv6 is more efficient tha

Define router. explain its type, Question 1 Define Router. Explain its typ...

Question 1 Define Router. Explain its type Question 2 List and discuss the different concepts of EIGRP Question 3 Explain the concept of autonomous system Autonomo

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