Computer Science, asked by Rafel5681, 1 year ago

How to reverse an ArrayList in Java?

Answers

Answered by priyankabhasin327
0

Answer:

Explanation:Collections.reverse() method reverses the elements of the given ArrayList in linear time i.e it has the time complexity of O(n). Collections.reverse() method takes List type as an argument. So you can use this method to reverse any List type like ArrayList, LinkedList or vector

Similar questions