I\'ve seen people mention that a random element can be grabbed from an unordered_set in O(1) time. I attempted to do so with this:
std::unordered_set
I believe you have misinterpreted the meaning of "random access", as it was used in those cases you're referring to.
"Random access" doesn't have anything to do with randomness. It means to access an element "at random", i.e. access any element anywhere in the container. Accessing an element directly, such as with std::vector::operator[]
is random access, but iterating over a container is not.
Compare this to RAM, which is short for "Random Access Memory".