diff --git a/list.cpp b/list.cpp index f61d73d..681ab36 100644 --- a/list.cpp +++ b/list.cpp @@ -5,8 +5,9 @@ void createList(List &L) { * FS : set first(L) with Null */ //-------------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); + } + } + } + //---------------------------------------- }