I want to remove the last object from an ArrayList quickly.
ArrayList
I know that remove(Object O) takes O(n) in an ArrayList,
remove(Object O)
O(n)
Just simply use.
arraylist.remove(arraylist.size() - 1)