[CSE2304] [progress]

CSSE, Monash University, .au, CSE2304, prac4, 2001

Write a C program,   compare f1 f2 f3 ...,   which accepts an arbitrary number of file names f1, f2, f3, ..., as [command line] parameters. Each file contains C-code which has been preprocessed, as in [prac#3].

Your program must calculate a weighted [graph], in which there is a vertex for each of the given files. Implement the graph by an adjacency matrix.


Group B, starts 7 May 2001

You may use this [LCS routine] if you wish.

The weight of the edge between fi and fj is defined to be w(i,j) = LCS(fi, fj) / min(|fi|, |fj|), where LCS is the length of the longest common subsequence of the contents of files fi and fj, as covered in prac#3.

Your program must print the adjacency matrix.
NB. [Prac#5] involves modifying your program.

[6 marks]

Group A, starts 14 May 2001

You may use this [BM routine] if you wish.

The weight of the edge between fi and fj is defined to be w(i,j) = min(BM(fi, fj), BM(fj, fi)), where BM is the block-moves distance between the contents of files fi and fj, as covered in prac#3.

Your program must print the adjacency matrix.
NB. [Prac#5] involves modifying your program.

[6 marks]


It is important to divide the various sub-tasks (e.g. read a file, compute w( ), etc.) into subroutines in a sensible way.

You may assume that (i) no file contains more than `maxLen' characters, (ii) there are no more than `maxFile' files, and (iii) the contents of all of the files can be read and stored in memory.

You cannot assume that as many as maxFile files can be open simultaneously.



© L. Allison, School of Computer Science and Software Engineering, Monash University, Australia 3168.