Ds A Assignment No. 1
Ds A Assignment No. 1
Identi( )
The Identi() method performs as described below.
Identi () takes the list and, wherever two or more consecutive items are the same, it removes identical nodes so that only
one consecutive copy remains. Hence, no two consecutive items in this list are equal upon completion of the procedure.
After Identi() executes, the list may well be shorter than when Identi() began. No extra items are added to make up for
those removed.
Here is the prototype of the Identi() function that you will use in your code.
List Identi(List list);
alike( )
The alike() method performs as described below.
alike() takes the list and doubles its length by replacing each node with two consecutive nodes referencing the same
item. For example, if the input list is [ 1 5 3 7 2 ], the output list is [ 1 1 5 5 3 3 7 7 2 2 ].
Here is the prototype of the alike() function that you will use in your code.
List alike(List list);