Is there a fast concat method for linked list in Java?
- by rocker
How can I concat two linked lists in O(1) with Java via jdk, google or apache commons collection or whatever? E.g. in jdk there is only the addAll method which is O(n).
Another feature I miss is to concat two lists where each of them could be in inverse order. To illustrate this assume two lists a-b-c and e-f-g could merged into
a-b-c-e-f-g …