WhitePaper's blog

By WhitePaper, history, 8 years ago, In English

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.

  • Vote: I like it
  • -2
  • Vote: I do not like it

| Write comment?
»
8 years ago, hide # |
Rev. 2  
Vote: I like it +1 Vote: I do not like it

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.