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

Recognize the definition of demarcation, Demarcation is the point in which ...

Demarcation is the point in which responsibility changes hands.

Distance-vector routing, Local information is immediate hop routing table a...

Local information is immediate hop routing table and distance from every switch. The switches regularly broadcast topology information i.e. distance, destination. Other switches mo

What do you meant by triple x in networks, What do you meant by "triple X" ...

What do you meant by "triple X" in Networks? The function of PAD (Packet Assembler Disassembler) is defined in a document known as X.3. The standard protocol has been explaine

Packet sizes, Large data packets result in fewer load because a smaller par...

Large data packets result in fewer load because a smaller part of the packet is used for header information. Optimum networks use 4kB data packets or larger. Large data packets

What is domain name, Domain Name A domain name is a way to recognize an...

Domain Name A domain name is a way to recognize and locate computers connected to the Internet.  This is a text name of a computer in network or Internet. Domain names are chan

Half duplex ethernet operation, Half-Duplex - Capability for data transmis...

Half-Duplex - Capability for data transmission in only single direction at a time among sending station and a receiving station.

Session layer standards, Session layer protocols consists of NFS, SQL, RPC,...

Session layer protocols consists of NFS, SQL, RPC, Appletalk Session Protocol (ASP), XWindows, and NetBEUI.

What is data encapsulation, What is data encapsulation? Data encapsulat...

What is data encapsulation? Data encapsulation is the method of breaking down information into smaller manageable chunks before it is transferred across the network. It is also

Explain about traffic shaping, Q. Explain about Traffic shaping ? Traf...

Q. Explain about Traffic shaping ? Traffic shaping -Method to control the amount and the rate of the traffic sent to the network.? Leaky bucket Token bucket -

Define the term - proxy servers, Define the term - Proxy servers These ...

Define the term - Proxy servers These types of firewalls have been further classified into two types: application level gateways and circuit level gateways. The application

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