diff --git a/list.cpp b/list.cpp index f61d73d..7784de3 100644 --- a/list.cpp +++ b/list.cpp @@ -6,7 +6,7 @@ void createList(List &L) { */ //-------------your code here------------- cout<<"your code here"< 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,Q,P); + } + } + } //----------------------------------------