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

Автор Yousef_Sameh, история, 15 месяцев назад, По-английски

in this problem when I used an unordered map I got TLE and used the same solution with map I got ACC I need an explanation, please

I really appreciate any help you can provide.

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

»
15 месяцев назад, # |
Rev. 3   Проголосовать: нравится +12 Проголосовать: не нравится

Because Unordered map(HashTable) has worst case time complexity of O(n^2). That happens in case of collisions and since there was hacking available. Hackers added anti-hash tests so it got the unordered map to have O(n^2) and thus TL

Map(Self Balancing BST) always O(log n)

»
15 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You should read this.