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

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

I saw that some people use trie structure using linked list by pointer while other people built that linked list using array. My question is which approach is more efficient.

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

»
8 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +1 Проголосовать: не нравится

The array is much faster in most cases,

But sometimes the array need a huge space in comparison with the pointer approach, Look at this problem on Spoj Link

You may get MemoryLimitExceeded if you solve this problem using array in some online judges.