diff --git a/Commissions/flis/IMT/Case3/case3.c b/Commissions/flis/IMT/Case3/case3.c index 91c94b1..7445ed9 100644 --- a/Commissions/flis/IMT/Case3/case3.c +++ b/Commissions/flis/IMT/Case3/case3.c @@ -48,7 +48,7 @@ int main(void) { int len_number = strlen(number); for (int j = 0; j < len_number; j++) { // loop over chars in the phone number int index = number[j] - '0'; // Go to the node we're testing - if (pointer->children[index == NULL]) { + if (pointer->children[index] == NULL) { pointer->children[index] = newNode(); }; pointer = pointer->children[index]; @@ -69,7 +69,7 @@ int main(void) { printf("FOUND PREFIX IN NUMBER\n"); printf("%s and %s", number, number); while (pointer->isEnd != true) { // follow the first path you can find - for (int k = 0; k < 10; k++) { + for (int k = 0; k < 10; k++) { if( pointer->children[k] != NULL) { pointer = pointer->children[k]; printf("%c", k + '0'); // Print the path as we go @@ -83,7 +83,7 @@ int main(void) { }; pointer->isEnd = true; }; - else if (pointer->isEnd == true) { // if we've already seen a shorter number with this prefix + if (pointer->isEnd == true) { // if we've already seen a shorter number with this prefix printf("Found prefix!\n"); for (int k = 0; k < j; k++) { printf("%c", number[k]);