Odd-even transposition algorithem, Computer Networking

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

Posted Date: 3/2/2013 6:53:00 AM | Location : United States







Related Discussions:- Odd-even transposition algorithem, Assignment Help, Ask Question on Odd-even transposition algorithem, Get Answer, Expert's Help, Odd-even transposition algorithem Discussions

Write discussion on Odd-even transposition algorithem
Your posts are moderated
Related Questions
Which form of PPP error detection on Cisco routers monitors data dropped on a link?  Ans) The Quality protocol monitors data dropped on a link. Magic Number avoids frame looping

define reliable transmission of data

Extranet and Intranet An Extranet is a type of Intranet (Internal TCP/IP Network) that has been selectively opened to a firm's suppliers, customers. Intranet An intrane

When a P is returned when a Trace is run, it means the Protocol is unreachable.

What is difference among routing and routed protocols? Ans) i) Routing use for top path selection ii) Routed protocol carries on source and destination information.

Question: (a) What is a script kiddie? Is it a significant security threat, and why? (b) Assume that UNIX uses the user login name in lieu of the traditional salt, what is

Enumerate about the Virtual Private Network (VPN) Even though, many firewalls also include the features of the virtual private network, the functionality and capabilities of V

Take the maximum packet lifetime, T.  It's stated that T must be big enough to make sure the packet and its ACK have vanished.  Why do we have to have the ACK?

Which layers are user support layers? Three layers are come under user support layer:- a. Session Layer b. Presentation Layer and c. Application Layer

show ipx servers is the command that shows the SAP table