Opus5.Application9

Explanation

This application illustrates the use of a partition to compute equivalence classes. It uses the equivalenceClasses method given in Program 12.25.

The source code for the main method is available here.

Instructions

This is an interactive application. Type your input in the white text area underneath the "screen" below. Press Enter to cause the input in the text area to be passed to the application. Terminate your input by typing Control-D.

The input is a sequence of integers. The first integer specifies the size of the universe of the partition. The remainder of the input consists of pairs of integers. As each pair of integers (i,j) is entered, the application performs a join operation to join the elements of the partition containing i and j. After all the join operations have been performed, the application prints the resulting partition.


Bruno
Copyright © 1999 by Bruno R. Preiss, P.Eng. All rights reserved.