4 thoughts on “Java standard data structures Big O notation

  1. Pingback: PROG Java vraagje - Pagina 2 - 9lives - Games Forum

  2. The remove operation for LinkedList is generally O(n), not O(1), because the LinkedList needs to seek to the element before it can remove that element from the list. Reading this cheat sheet, it’s a bit ambiguous because at first I thought it said remove(O), as in remove(Object o)… but in reality, this is remove(0), as in removing the first element at index 0 (zero) of the LinkedList.

    On the page with the updated cheat sheet, this was discussed.

    http://www.coderfriendly.com/2009/05/23/java-collections-cheatsheet-v2/

    I’d suggest using a better font. Then again, I’d also suggest that general remove() behavior is more useful to know than the behavior of remove(0) which is a special case.

  3. Pingback: Time complexities of Data Structures | Dhara Shah

Leave a comment