Closed danielworkman closed 3 years ago
HashSet
ArrayList
O(h/n)
h
O(1)
import
Yep, seems sensible. Not sure if it'll make that much difference but all helps. I imagine this will make deleting things etc. slower but we can easily afford that.
HashSet
toArrayList
O(h/n)
, (whereh
is the capacity) toO(1)
and b) retains the original orderingimport