0

I am writing a flutter app. For this I have to cache some places and want to search for names. For this purpose, I would like to use a radix trie. I have searched for implementations under dart, but I have not found anything useful.

Did anyone know where I can find an implementation? Or has anyone ever bothered?

Greetings Dagobert

Dagobert
  • 31
  • 5
  • I think it will be a few thousand. I just can not think of another elegant data structure. Do you happen to have a suggestion? – Dagobert May 09 '19 at 06:31
  • https://api.dartlang.org/stable/2.3.0/dart-collection/dart-collection-library.html – pskink May 09 '19 at 06:38
  • I know that lib. But there are no trees inside. Or has it just another name? – Dagobert May 09 '19 at 06:54
  • `SplayTreeMap` maybe? the docs say: *"A Map of objects that can be ordered relative to each other. The map is based on a self-balancing binary tree. It allows most operations in amortized logarithmic time."* – pskink May 09 '19 at 06:55
  • Hm .. SplayTreeMap is more a BST implementation, right? I need a tree with a suffix list or something similar. I enter a key and want to get all the objects that contain this key. – Dagobert May 09 '19 at 07:02

1 Answers1

1

Radix-Trees are also called Tries, Digital-Trees and Prefix-Trees.

You can find a Dart implementation of a Trie here

modulovalue
  • 31
  • 1
  • 6