This is base on Gist by Psayre23. I just improve some data and add my own notes regard to this topic.
Below are the Big O performance of common functions of different Java Collections.
List | Add | Remove | Get | Contains | Next | Size | Data Structure |
---|---|---|---|---|---|---|---|
ArrayList | O(1) | O(n) | O(1) | O(n) | O(1) | O(1) | Array |