How to reverse an ArrayList in Java?
Answers
Answered by
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
Hindi,
7 months ago