The first question has a simple but disappointing answer: you cannot delete the last element in constant time, as this will require a link to the element to the last. (This is a separate list, inside a wrapper class that contains the start and end elements of a list.)
The second question is equally simple and perhaps disappointing: The Scala Iterator is just a collection view. They do not modify the base collection. (This corresponds to the “immutable by default, mutable only when necessary” philosophy.)
source share