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

Flash-nvram-system buffer-interface buffer, Flash It is also permanent...

Flash It is also permanent storage device. It stores the compressed form of Cisco IOS software image and the NVRAM data. Device structure One flash socket Support 80

Distributed enrollment protocol dep, Introduction: This is a specialized p...

Introduction: This is a specialized protocol designed for CS5244. It provides a distributed means to access a BasicEnrollmentManager implementation through client-server communica

Comparison of connection-oriented and connectionless, CONNECTION-ORIENTED: ...

CONNECTION-ORIENTED: Accounting is simpler. Application can learn of network causes immediately. CONNECTIONLESS: It has fewer load. It is easier to cre

Data link layer responsibilities, Q. Data Link Layer Responsibilities? ...

Q. Data Link Layer Responsibilities? - Defines frames into manageable data units - Physical addressing - Flow control - Error control - Access control Nod

Disadvantages of ip sec tunnelling mode, Disadvantages of IP sec  Tunnelli...

Disadvantages of IP sec  Tunnelling mode IP sec  tunnelling  mode has the  following  disadvantage a.Encryption of  small  packets  generates a lot  networks  over head  thu

command saves the configuration stored in ram to nvram, Which command save...

Which command saves the configuration stored in RAM to NVRAM Ans) copy running-config startup-config is the command which saves the configuration stored in RAM to NVRAM

Networking security, difference between spambox and inbox in gmail

difference between spambox and inbox in gmail

Determine about the internet, Determine about the Internet The I...

Determine about the Internet The Internet as a source of information and reference material, browsing the World Wide Web (WWW) and Newsgroups for the latest gossip or sh

Banking industry, Will like to know what is the standard industrial practic...

Will like to know what is the standard industrial practice for a bank network design? Preferably with complete paper on the network design covering security, domain segregation, vi

#incident response scenario, assignment is for incident response In this ...

assignment is for incident response In this final week, you will provide a short procedures document (2–3 pages) concerning the steps by which to prepare for and execute expert te

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