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

Автор Terror_404, история, 2 года назад, По-английски

Can Anybody give me the sample code of implementation of basic trie using multidimensional arrays. I saw various programmers using this. And i personally feel i will be a lot more comfortable in handling arrays than using node pointers in tries.

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

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

Auto comment: topic has been updated by Terror_404 (previous revision, new revision, compare).

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

Auto comment: topic has been updated by Terror_404 (previous revision, new revision, compare).

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

can't it be implemented using an adjacency list? I don't remember exactly as I learnt it a long time ago but any information will be appreciated.

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

Here is a simple implementation problem and a solution with an array-based trie to this problem. The code should hopefully be clear enough for you to figure out what's happening.

Statement:
Example:
Code: