Hacker News new | past | comments | ask | show | jobs | submit login

std::deque has O(1) access by index so it's fine for random access (although it has some extra indirection so it's still slower than vector)



It's O(1), for high values of 1.


Wow I was literally reading the docs last night and didn’t notice operator[]! Good to know




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: