Fastest way to search and sort vectors

前端 未结 6 1489
甜味超标
甜味超标 2021-01-02 18:16

I\'m doing a project in which i need to insert data into vectors sort it and search it ...

i need fastest possible algorithms for sort and search ... i\'ve been sea

6条回答
  •  情深已故
    2021-01-02 18:32

    For amortised O(1) access times, use a [std::unordered_map], maybe using a custom hash for best effects.
    Sorting seems to be unneccessary extra work.

提交回复
热议问题