#include "def.h"

CheckPrefix(Key, Word)
char *Key,    /* Possible New Key */
*Word;   /* The Key Stored in the B-Tree */
{
	int m = min(strlen(Key), strlen(Word));
	if (strlen(Key) > strlen(Word)) { /* Key cannot possibly be the prefix */
		return(2);
	}

	int i =0;
	for(i = 0; i < strlen(Key); i++) {
		if (Key[i] < Word[i]) {
			return(1);
		} else if (Key[i] > Word[i]) {
			return(2);
		}
	}
	return(0);
}


