trie_search 0.0.1 copy "trie_search: ^0.0.1" to clipboard
trie_search: ^0.0.1 copied to clipboard

A special data structure used to store strings that can be visualized like a graph.

Trie Data Structure in Dart #

This package provides a basic implementation of a Trie data structure in Dart. It offers functionalities like inserting words, searching by prefix, and clearing the Trie, making it an efficient solution for handling prefix-based search operations.

Features #

  • Efficient word insertion: Adds words to the Trie with associated details.
  • Prefix-based search: Retrieve all words starting with a given prefix.
  • Memory efficient: Significantly more memory-efficient than using a List for large datasets.
  • Clear method: Easily reset the Trie by deleting all stored data.

Getting Started #

To start using the Trie package, follow these steps:

  1. Add the package to your pubspec.yaml file:

    dependencies:
      trie_data_structure: ^0.0.1
    
  2. '''dart import 'package:trie_data_structure/trie_data_structure.dart';

void main() { // Initialize a Trie with some initial data Trie

// Inserting additional words trie.insert('batman', 'A superhero'); trie.insert('balloon', 'A light inflated object');

// Searching for words with a given prefix print('Words with prefix "app":'); Set

// Clearing the trie trie.clear(); print('Trie cleared.');

// After clearing, trying to search again Set

'''

12
likes
0
points
29
downloads

Publisher

unverified uploader

Weekly Downloads

A special data structure used to store strings that can be visualized like a graph.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on trie_search