diff --git a/Project2/Debug/Project2.Build.CppClean.log b/Project2/Debug/Project2.Build.CppClean.log new file mode 100644 index 0000000..0ace058 --- /dev/null +++ b/Project2/Debug/Project2.Build.CppClean.log @@ -0,0 +1,17 @@ +c:\code\lencode\project2\project2\debug\vc143.pdb +c:\code\lencode\project2\project2\debug\vc143.idb +c:\code\lencode\project2\project2\debug\sq_list.obj +c:\code\lencode\project2\project2\debug\main.obj +c:\code\lencode\project2\project2\debug\linked_list_stack.obj +c:\code\lencode\project2\project2\debug\linked_list.obj +c:\code\lencode\project2\debug\project2.exe +c:\code\lencode\project2\debug\project2.pdb +c:\code\lencode\project2\project2\debug\project2.ilk +c:\code\lencode\project2\project2\debug\project2.tlog\cl.command.1.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\cl.items.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\cl.read.1.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\cl.write.1.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\link.command.1.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\link.read.1.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\link.secondary.1.tlog +c:\code\lencode\project2\project2\debug\project2.tlog\link.write.1.tlog diff --git a/Project2/Debug/Project2.log b/Project2/Debug/Project2.log index e69de29..259d036 100644 --- a/Project2/Debug/Project2.log +++ b/Project2/Debug/Project2.log @@ -0,0 +1,2 @@ + main.c + Project2.vcxproj -> C:\code\lencode\Project2\Debug\Project2.exe diff --git a/Project2/Debug/Project2.tlog/CL.command.1.tlog b/Project2/Debug/Project2.tlog/CL.command.1.tlog index 3dcb4bf..5c9a976 100644 Binary files a/Project2/Debug/Project2.tlog/CL.command.1.tlog and b/Project2/Debug/Project2.tlog/CL.command.1.tlog differ diff --git a/Project2/Debug/Project2.tlog/CL.read.1.tlog b/Project2/Debug/Project2.tlog/CL.read.1.tlog index e69de29..a8ecbf7 100644 Binary files a/Project2/Debug/Project2.tlog/CL.read.1.tlog and b/Project2/Debug/Project2.tlog/CL.read.1.tlog differ diff --git a/Project2/Debug/Project2.tlog/CL.write.1.tlog b/Project2/Debug/Project2.tlog/CL.write.1.tlog index e69de29..6fe6733 100644 Binary files a/Project2/Debug/Project2.tlog/CL.write.1.tlog and b/Project2/Debug/Project2.tlog/CL.write.1.tlog differ diff --git a/Project2/Debug/Project2.tlog/link.command.1.tlog b/Project2/Debug/Project2.tlog/link.command.1.tlog index 21a31c1..71d5a57 100644 Binary files a/Project2/Debug/Project2.tlog/link.command.1.tlog and b/Project2/Debug/Project2.tlog/link.command.1.tlog differ diff --git a/Project2/Debug/Project2.vcxproj.FileListAbsolute.txt b/Project2/Debug/Project2.vcxproj.FileListAbsolute.txt new file mode 100644 index 0000000..e69de29 diff --git a/Project2/Debug/main.obj.enc b/Project2/Debug/main.obj.enc deleted file mode 100644 index c7bca44..0000000 Binary files a/Project2/Debug/main.obj.enc and /dev/null differ diff --git a/Project2/Debug/sq_list.obj.enc b/Project2/Debug/sq_list.obj.enc deleted file mode 100644 index a3369ec..0000000 Binary files a/Project2/Debug/sq_list.obj.enc and /dev/null differ diff --git a/main.c b/main.c index 347e136..e0e8a3c 100644 --- a/main.c +++ b/main.c @@ -22,9 +22,9 @@ int main(void) L->length = 10; print_sq_list(N); print_sq_list(L); - merge_sq_list(N,L); - print_sq_list(N); - printf("L->length:[%d]\n", N->length); + mer_ge_sq_list(L,N); + print_sq_list(L); + printf("L->length:[%d]\n", L->length); printf("Hello World!\n"); system("pause"); return 0; diff --git a/sq_list.c b/sq_list.c index 9ff8dfc..92cb36d 100644 --- a/sq_list.c +++ b/sq_list.c @@ -64,7 +64,7 @@ void insert_sq_list(sq_list* list, int pos, int value) } list->data[pos] = value; /* if (flog + 1 > list->length)*/ - list->length++; + list->length++; } @@ -117,7 +117,7 @@ int locate_list(sq_list* list, int *e) -// 2 µ½ 1 +// 2 µ½ 1 ºÏ²¢ void merge_sq_list(sq_list* list_1, sq_list* list_2) { if (list_1->length == 0 || list_2->length == 0) @@ -152,21 +152,25 @@ void merge_sq_list(sq_list* list_1, sq_list* list_2) printf("----------------------------------\n"); } -//if (list_1->data[j] != list_2->data[i]) -//continue; -//else if (list_1->data[j] == list_2->data[i]) -//break; + //ºÏ²¢2.0 void mer_ge_sq_list(sq_list* list_1, sq_list* list_2) { int e; int k = 0; + int flog = 0; for (int k=0;k < list_2->length;k++) { get_sq_list(list_2, k, &e); if (!locate_list(list_1, list_2)) + { insert_sq_list(list_1, list_1->length, e); + flog++; + } } + printf("----------------------------------\n"); + printf("ÓÐ%d²»Ïàͬ ÓÐ%dÏàͬ\n", flog, list_2->length - flog); + printf("----------------------------------\n"); }