Returns the element at the specified position in this set.
Returns the element at the specified position in this set.Retrieving the first or last element of a hash set has a time complexity of O(N), with N being the capacity of the set.
Retrieving the first or last element of a tree set has a time complexity of O(Log N), with N being the size of the set.
For any set retrieving a random element from any set has O(N), with N being the size of the set.