import java.util.ArrayList; import java.util.Scanner; /** * Satisfies Problem 19.a.ii of Homework 1. Quoting from the assignment: *
* Reads a graphical representation of a comparator network on standard
* input and produces the corresponding linear representation on
* standard output, with the following additional constraints:
* Each line of output, except the last, contains exactly 10
* integers. There is exactly one space following each integer in
* the output, unless that integer is the last one on a line, in
* which case the space is replaced by a single newline
* character.
* @author Ed Ropple
*/
public class CnetGraToLinMain {
/**
* Entry method of cnet-gra-to-lin. Accepts input and passes to cnetlib's
* shared functions in order to return a list of ComparatorPairs, which are
* then sent to standard output.
*
* @param args The command line arguments for the program. Are ignored
* by this program.
*/
public static void main(String[] args) {
ArrayList