[Cs3] Sample Midterm

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Oct 7 10:30:48 EDT 2019


> 
> What is the explanation for problem 4? Why is splice only implemented for
> list?

That's problem number 3. 

In case of lists, the implementation of splice() requires the
manipulation of finite (about 4) pointers and does not depend on the
size of the two lists being spliced. In case of other sequential
containers, for example vectors, the implementation of a similar
operation would require buffer re-allocation and container element
movement which would be proportional to the container size.

Thanks,
--
Mikhail


More information about the cs3 mailing list