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

Describe the specific ip-qos schemes, State how the different IP-QoS needs ...

State how the different IP-QoS needs for controling traffic, data and voice applications can be supported in your technology choice from Q7. Describe the specific IP-QoS schemes -

Show nonreturn to zero encoding, Q. Show Nonreturn to Zero encoding? - ...

Q. Show Nonreturn to Zero encoding? - Value of signal is for all time positive or negative - NRZ-L Signal level depends on bit represented; positive typically means 0

Analyze snort or pcap data from a public wifi hotspot, The project idea is ...

The project idea is : Analyze Snort or PCAP data from a public WIFI hotspot (describe traffice seen and what it is, protocols, ports, etc). This is what is expected. Initially r

Logged into a router, You are logged into a router, what command would repr...

You are logged into a router, what command would represent you the IP addresses of routers linked to you? Ans)show cdp neighbors detail

Determine the subnet with subnet prefix, Consider a subnet with subnet pref...

Consider a subnet with subnet prefix 101.101.101/24  a)  If you subdivide the subnet into four equal size subnets, what are their prefixes? Give all four prefixes in the form a.

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

Approach for client - server communication, Client Once the GUI applicat...

Client Once the GUI application is loaded, it will send a request (instance/object of Commands class) to server for a list of files from the server's shared directory.Client wil

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