Computer Science Homework Solutions
Problem
#107824

Describe an efficient algorithm to determine the depth of a comparison network with given representation.

Mr. Johnson draws an n-input comparison network with m comparators according to the following conventions.

The lines of the network go left-to-right, and comparators are drawn vertically to connect two lines. The network is drawn on an underlying grid, so that each comparator occupies one of at most m columns. Comparators can share columns, but they do not overlap.

Mr. Johnson represents a given drawing as a list L of triples, in which each triple (x, y, c) represents a comparator connecting line x to line y in column c.

Describe an efficient algorithm to determine the depth of a comparison network, where the input is Mr. Johnson's representation of a drawing of the network. Analyze your algorithm in terms of m and n.

Please look at the attachment for an example of his drawing and representation of a 4-input sorting network.

Attached file(s):
Attachments
Mr Johnson.doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Mr Johnson.doc
Mr. Johnson draws an n-input comparison network with m comparators
according to the following conventions. The lines of the network go
left-to-right, and comparators are drawn vertically to connect two
lines. The network is drawn on an underlying grid, so that each
comparator occupies one of at most m columns. Comparators can share
columns, but they do not overlap. An example of such a drawing is given
below for a 4-input sorting networks.

1 2 3 4







































Mr. Johnson represents a given drawing as a list L of triples, in which
each triple (x, y, c) represents a comparator connecting line x to line
y in column c. For example, a representation of the sorting network
above might be the list L = ( (2,4,3), (1,3,2), (1,2,1), (2,3,4), (3, 4,
1)(. Describe an efficient algorithm to determine the depth of a
comparison network, where the input is Mr. Johnson’s representation of
a drawing of the network. Analyze your algorithm in terms of m and n.

1

2

3

4

Solution Summary

Solution describes an O(max{m,n}) algorithm to determine the depth of an n-input comparison network with m comparators, with pseudocode interspersed with detailed explanations and performance analysis of steps in algorithm.

Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$59.85)
Included in Download
  • Plain text response
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
  • Logic - Do we need combinational logic, sequential logic, or a combination of the two to implement each of the following: a. multiplexor b. comparator c. incrementer/decrementer d. barrel shifter e. m ...
  • star configuration & 802.3 LAN - A seven-story office building has 15 adjacent offices per floor. Each office contains a wall socket for a terminal in the front wall, so the sockets form a rectangular grid in the vertical plane, with ...
  • Linda has been assigned the job of connecting five computers to a network. - Linda has been assigned the job of connecting five computers to a network. The room holding the five computers has three network ports that connect to a hub in an electrical closet down the hallway. L ...
  • Miracle C compiler problem in compiling currency conversion program - I ran the previous problem but still got errors maybe it is the compiler we have to use which is Miracle C. This is the error that I have. unrecognised types in comparison 'while (Amount<=0)' ( ...
  • Write a computer program - Give the pseudo algorithms for the first five approaches. See attached file for full problem description.
Browse