diff --git a/ASD_Task_2.depend b/ASD_Task_2.depend index 4a87b2d..f42cccc 100644 --- a/ASD_Task_2.depend +++ b/ASD_Task_2.depend @@ -29,3 +29,18 @@ "list.h" "operation.h" +1581205956 source:c:\users\computer\documents\github\asd_task_2\main.cpp + + "list.h" + "operation.h" + +1581206928 c:\users\computer\documents\github\asd_task_2\list.h + + +1581205357 c:\users\computer\documents\github\asd_task_2\operation.h + "list.h" + +1581207158 source:c:\users\computer\documents\github\asd_task_2\operation.cpp + "list.h" + "operation.h" + diff --git a/ASD_Task_2.layout b/ASD_Task_2.layout index e69ac9c..c142c7b 100644 --- a/ASD_Task_2.layout +++ b/ASD_Task_2.layout @@ -2,29 +2,29 @@ - + - + - + - + - + - + - + - + - + - + diff --git a/Main.cpp b/Main.cpp index 297d6ca..f3dfaf8 100644 --- a/Main.cpp +++ b/Main.cpp @@ -34,7 +34,7 @@ int main() { //================================================== // TEST INSERT AFTER P = findElm(L, 6); - insertLast(L, allocate(5)); + insertAfter(L, P, allocate(5)); printInfo(L); cout<<"output should be: 8, 3, 6, 5, 4, 2,"< x){ + insertFirst(L, allocate(x)); + } else if (findElm(L, x) == NULL){ + while (P != NULL && info(P) < x){ + Q = P; + P = next(P); + } + insertAfter(L, Q, allocate(x)); + } //---------------------------------------- }