0

I am writing a lazy propagation code using the segment tree data structures. For doing the lazy propagation I wanted to store a list of integers at a node in the segment tree and while carrying the lazy propagation I wanted to append the list of integers of the node to the left and the right children. In order to maintain the complexity of the update method in Segment Trees to Log(n) time I wanted to do the lazy update at a node in O(1) time. So for storing the list of integers I can use Vectors or LinkedList in Java. Vectors in java have a method called addAll and LinkedList also has the same method. Could anyone please suggest me which one of two would be more optimized for just adding all elements of one list to another. Thanks

4

0 回答 0