Arrays and lists

Agree. The linked list approach is optimum in terms of temporary memory occupation and minimum amount of data movements. It requires (slightly) more code, though.