What is the difference between a HashSet and a TreeSet in Java?
A HashSet does not maintain any specific order of elements, whereas a TreeSet stores elements in a sorted order, according to their natural ordering or a comparator.
Great! You've got the key differences between HashSet and TreeSet down.
Can you explain the time complexities for basic operations like `add`, `remove`, and `contains` in both HashSet and TreeSet?