diff --git a/Main.cpp b/Main.cpp index 297d6ca..79a5b98 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,"<info(next(Q)))){ + Q = next(Q); + if(next(Q)==NULL){ + P = allocate(x); + insertLast(L,P); + } else if(info(P)!=info(Q)){ + P = allocate(x); + insertAfter(L,P,Q); + } + } //---------------------------------------- + } }