9 marksAbstract Data Types (ADTs)
CAPE Computer Science Unit 2 · 2006 · Paper 2 · Question 4(a)
A list L1 contains 100 elements, and a list L2 of size 150 has 20 elements stored in its first 20 locations (indices 0 to 19). Write an algorithm to move all elements of L1 to L2 starting at the first location of L2, placing the existing 20 elements immediately after the elements from L1, and then set all elements in L1 to zero.
The mark scheme is shown once you've answered.
Practise this question