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

How is computer networks used in teleconferencing, Q. How is computer netwo...

Q. How is computer networks used in teleconferencing? Teleconferencing: Teleconferencing allows conference to happen without the participants being in the same place. Applica

Different types of subnet classfull networks are present, How many dissimil...

How many dissimilar types of subnet classful networks are present?

Introduction to performance evaluations, INTRODUCTION In this part, th...

INTRODUCTION In this part, the topic of performance evaluation shows those parameters that are devised to calculate the performances of various parallel systems. Achieving the

Describe the automatic repeat request protocol, Question 1: (a) In net...

Question 1: (a) In networking, there are different possible topologies. Explain the Linear bus, Ring and Star topology along with their advantages and disadvantages. (b) W

Layers, what are the layers covered under end to end later connectivity?

what are the layers covered under end to end later connectivity?

the default settings of ipx delay number, The "ipx delay number" command w...

The "ipx delay number" command will permit an administrator to alter the default settings. Explain the default settings? Ans) For LAN interfaces, one tick; for WAN interfaces, s

What are the unix-based firewalls, What are the Unix-based firewalls T...

What are the Unix-based firewalls The Unix-based firewalls are considered most secured as compared to the Windows NT based ones. The firewalls bind the holes of the operating

Sorting using interconnection networks, The combinational circuits use the ...

The combinational circuits use the comparators for comparing the storing and number them on the basis of minimum and maximum functions. Likewise, in the interconnection networks th

What is osi and what role does it play in computer networks, What is OSI an...

What is OSI and what role does it play in computer networks? OSI (Open Systems Interconnect) serves as a reference model for data communication. It is made up of 7 layers, with

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