🌝Coding/🌟JAVA

[JAVA] contains() 시간복잡도

뿌야._. 2024. 11. 8. 17:33

💡 HashSet

✔️ O(1)

✔️ HashMap 기반으로 구현

 

💡 ArrayList

✔️ O(n)

✔️ indexOf()를 사용하여 포함 여부 결정