I think it works now
This commit is contained in:
parent
79c639faa5
commit
a5aa29f1ac
@ -37,8 +37,6 @@ int numbers[] = {113, 11354, 77777, 255044};
|
||||
|
||||
int main(void) {
|
||||
struct Node* root = newNode();
|
||||
printf("%p\n", root);
|
||||
|
||||
int n_numbers = sizeof(numbers)/sizeof(int);
|
||||
|
||||
for (int i = 0; i < n_numbers; i++) { // Go through all the phone numbers in the global list
|
||||
@ -66,7 +64,6 @@ int main(void) {
|
||||
};
|
||||
};
|
||||
if (continues == true) {
|
||||
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++) {
|
||||
@ -82,13 +79,13 @@ int main(void) {
|
||||
return 0; // return true or success or whatever
|
||||
};
|
||||
pointer->isEnd = true;
|
||||
};
|
||||
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++) {
|
||||
}
|
||||
else if (pointer->isEnd == true) { // if we've already seen a shorter number with this prefix
|
||||
for (int k = 0; k <= j; k++) {
|
||||
printf("%c", number[k]);
|
||||
}
|
||||
printf("\n");
|
||||
printf(" and %i\n", numbers[i]);
|
||||
return 0;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
with import <nixpkgs> {};
|
||||
stdenv.mkDerivation {
|
||||
name = "c-shell";
|
||||
buildInputs = [ gcc gnumake ];
|
||||
buildInputs = [ gcc gnumake gdb ];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user