Detecting Source-Code Plagiarism
by Bob Zeidman

Figure 1: 

(a)
if (x == 5)
{
    // Loop on j here
    for (j = 0; j < Index; j++)
        printf("x = %i", j);
}
else
    while (i < 5) i++;  

(b)
CONDITIONAL_BEGIN
LOOP_BEGIN
DISPLAY
LOOP_END
CONDITIONAL_END
CONDITIONAL_BEGIN
LOOP_BEGIN
ARITHMETIC
LOOP_END
CONDITIONAL_END


Figure 2: 

(a)
Word1[0] = "abc"            Word2[0] = "Aabc"
Word1[1] = "abc1"           Word2[1] = "aBc"
Word1[2] = "abc123"         Word2[2] = "abc1111111"
Word1[3] = "abcdef"         Word2[3] = "abcXXXyz"
Word1[4] = "pdq"            Word2[4] = "i"
Word1[5] = "xxx"            Word2[5] = "j"
Word1[6] = "xyz"            Word2[6] = "pdq"
Word1[7] = "yyy"            Word2[7] = "X"

(b)
PartialWord[0] = "abc"
PartialWord[1] = "abc1"
PartialWord[2] = "xxx"
PartialWord[3] = "xyz"

Figure 3:

(a) 

File 1                                      File 2                       

1 /* ---- begin routine ---- */          1 /* find the file extension */ 
2 void fdiv(                             2 void file_divide(             
3   char *fname, // file name            3 char      *fname,             
4   char *path)   /* path */             4 char      *path)              
5 {                                      5 {                             
6   int Index1, j;                       6   int i, j;                    
7                                        7   while (1)     // loop here  
8   while (1)                            8     j = strlen(fname);         
9       j = strlen(fname);               9                               
10 // find the file extension           10                               

(b)
File 1                                       File 2            
3     char *fname, // file name         3 char      *fname,    
4     char *path)   /* path */          4 char      *path)     
9        j = strlen(fname);             8    j = strlen(fname);


Figure 4:


(a)

File 1                                     File 2
1 /* begin routine */               1 /* find the file extension */
2 void fdiv(                        2 void file_divide(
3    char *fname, // file name      3 char      *fname,
4    char *path)   /* path */       4 char      *path)    // path
5 {                                 5 {
6     int Index1, j;                6   int i, j; /* begin routine */
7                                   7   while (1)     // loop here
8     while (1)                     8     j = strlen(fname);
9        j = strlen(fname);         9
10    // find the file extension   10   switch (x)
11    if (x == 5) {                11   {

(b)                         

File 1                                      File 2
1 /* begin routine */              6    int i, j; /* begin routine */
4     char *path)   /* path */     4  char      *path)    // path
10    // find the file extension   1  /* find the file extension */


Figure 5. 

File 1                                 File 2
1 if (x == 5)                          1 if (xyz < 2)
2 {                                    2   for (jjj = 0; jjj < i; jjj++)
3    // Loop on j here                 3    {
4   for (j = 0; j < Index; j++)        4      printf("Hello world\n");
5       printf("x = %i", j);           5    }
6 }                                    6 else
7 else                                 7    while (i > 3) i--;
8   while (i < 5) i++;                 8





2


