From 8c5fa0df0d3a886f22e8e397ca2ed311da835601 Mon Sep 17 00:00:00 2001 From: msulthon Date: Sat, 8 Feb 2020 18:52:17 +0700 Subject: [PATCH] Muhammad sulthon-1301194008-IF 43 05 --- list.cpp | 61 ++++++++++++++++++++++++++++++++++++++++++--------- list.h | 6 ++--- operation.cpp | 29 +++++++++++++++++++++++- 3 files changed, 82 insertions(+), 14 deletions(-) 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); + } + } + } + //---------------------------------------- }