Блог пользователя GreyMaster

Автор GreyMaster, история, 11 лет назад, По-английски

Hello.

I need a little help about set data structure. Is it possible that access the i-th element of a set with O(1) ?

  • Проголосовать: нравится
  • -2
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +10 Проголосовать: не нравится

First of all, you cannot access an element of a std::set with less complexity than O(log(n)). And also you cannot access the i-th element of a set. But you can do this with a little trick.